{
    "slug": "url-encoder-and-decoder",
    "name": "URL Encoder and Decoder",
    "url": "https://directory.milunir.com/developer-tools/encoders-decoders/url-encoder-and-decoder/",
    "description": "Encode text for a URL or decode %XX codes back to text. Pick query value (%20), form data (+) or whole URL; UTF-8 bytes per RFC 3986.",
    "inputs": {
        "type": "object",
        "properties": {
            "mode": {
                "type": "string",
                "enum": [
                    "encode",
                    "decode"
                ],
                "description": "Mode",
                "default": "encode"
            },
            "plain": {
                "type": "string",
                "description": "Text to encode"
            },
            "style": {
                "type": "string",
                "enum": [
                    "component",
                    "form",
                    "full"
                ],
                "description": "Encode as",
                "default": "component"
            },
            "encoded": {
                "type": "string",
                "description": "Encoded text or URL"
            },
            "plus_space": {
                "type": "boolean",
                "description": "Read + as a space. Form data and many query strings write a space as +. Turn this off to keep + as a plus sign.",
                "default": true
            }
        },
        "additionalProperties": false
    },
    "outputs": [
        {
            "key": "primary",
            "label": "Result"
        },
        {
            "key": "escapes",
            "label": "Percent escapes"
        },
        {
            "key": "length",
            "label": "Result length"
        },
        {
            "key": "input_length",
            "label": "Input length"
        }
    ],
    "modes": [
        {
            "id": "encode",
            "label": "Encode",
            "inputs": [
                "plain",
                "style"
            ]
        },
        {
            "id": "decode",
            "label": "Decode",
            "inputs": [
                "encoded",
                "plus_space"
            ]
        }
    ],
    "feed": null,
    "endpoint": "https://api.tools-directory.workers.dev/v1/tools/url-encoder-and-decoder",
    "mcp_tool": "url_encoder_and_decoder",
    "example": {
        "inputs": {
            "mode": "encode",
            "plain": "À",
            "style": "component"
        },
        "output": "Result: %C3%80\nPercent escapes: 2\nResult length: 6"
    }
}