Skip to content
MagicDocTool

URL Encoder / Decoder

Percent-encode or decode URLs and query strings, and break any URL into protocol, host, path and query parameters.

Runs in your browser — your data never leaves your device
Waiting for input

URL parser

Break a URL into its parts
Protocol
https:
Origin
https://api.example.com:8443
Host
api.example.com:8443
Hostname
api.example.com
Port
8443
Path
/v1/search
Query
?q=caf%C3%A9%20au%20lait&tag=hot&tag=new&page=2
Fragment
#results
Username
user
Password
••••••

Query parameters (4)

#KeyValue (decoded)
1qcafé au lait
2taghot
3tagnew
4page2

How to use URL Encoder / Decoder

  1. 1

    Paste your text or URL

    Enter a URL, query string or any text you want to encode or decode.

  2. 2

    Pick a mode

    Use Component mode for query values, or Full URL mode to keep the URL structure intact.

  3. 3

    Inspect the parts

    The parser shows protocol, host, path, hash and every query parameter in a table.

Frequently asked questions

What is the difference between encodeURIComponent and encodeURI?

encodeURIComponent (Component mode) escapes every character with special meaning in a URL — including / ? # & = and + — so use it for individual query values or path segments. encodeURI (Full URL mode) leaves those reserved characters alone so a complete URL stays usable, escaping only spaces, non-ASCII text and a few unsafe symbols.

Should spaces be %20 or +?

In URL paths a space must be %20. In query strings submitted by HTML forms (application/x-www-form-urlencoded) spaces are written as +. Turn on "Spaces as +" to produce or decode form-style encoding.

Why do I get "invalid escape" when decoding?

A percent sign must be followed by two hexadecimal digits (like %2F). A stray % or a multi-byte UTF-8 sequence that has been cut off cannot be decoded. Encode the literal % as %25 to fix it.

Does the URL parser decode query parameters?

Yes. Every key and value is shown fully decoded, in order, including repeated keys such as tag=a&tag=b — the same way URLSearchParams in JavaScript reads them.