URL Encoder & Decoder

Percent-encode text so it can be placed safely in a URL or query string, or decode an encoded URL back into readable text. Choose between encoding a single component or a full URL, with optional form-style + for spaces.

  • 100% free
  • No sign-up
  • Runs in your browser
  • Updated

Component encodes every reserved character, including / ? & = and #. Use it for a single query value or path segment.

How to use the URL Encoder & Decoder

  1. 1Type or paste the text, URL or encoded string into the input box.
  2. 2Choose Component to encode a single value such as a query parameter, or Full URL to encode a complete address while keeping its structure.
  3. 3Tick Use + for spaces if you are working with HTML form data (application/x-www-form-urlencoded).
  4. 4Click Encode or Decode. Copy the output, or click Swap to move it back into the input for another round.

What is URL encoding?

URLs may only contain a limited set of ASCII characters. Letters, digits and a few symbols such as - _ . and ~ are safe anywhere, while characters like / ? & = and # have special meaning because they separate the parts of a URL. Spaces, accented letters, emoji and most other characters are not allowed at all.

URL encoding, also called percent-encoding, solves this by replacing each unsafe byte with a % sign followed by two hexadecimal digits. Text is first converted to UTF-8 bytes, so a single character can become several escapes. For example, a space becomes %20, an ampersand becomes %26 and the letter é, which is two bytes in UTF-8, becomes %C3%A9.

Component vs full URL encoding

Component mode uses the same rules as JavaScript's encodeURIComponent. It encodes every reserved character, including / ? & = and #, which is exactly what you want for a single query value or path segment. Encoding a/b?c=d this way gives a%2Fb%3Fc%3Dd, so the value cannot be mistaken for part of the URL structure.

Full URL mode follows encodeURI. It leaves the characters that give a URL its shape untouched and only encodes spaces, non-ASCII characters and other unsafe symbols. Encoding https://example.com/a b?q=café gives https://example.com/a%20b?q=caf%C3%A9, which is still a working link. Use this mode when you have a complete address, and Component mode when you are building one from pieces. If you are turning a page title into a clean path, a URL slug generator is usually a better fit than encoding.

Plus signs, form encoding and common errors

HTML forms submitted with the default encoding write spaces as + instead of %20. With the + option ticked, café & crème encodes to caf%C3%A9+%26+cr%C3%A8me, and when decoding, every + is treated as a space. Leave it unticked for ordinary URLs, because there a literal + is a valid character and should stay a plus.

Decoding fails when a % is not followed by two hexadecimal digits, such as a stray 100% in the text, or when the escapes do not form valid UTF-8, which happens if the original text was encoded with an older character set such as Latin-1. The tool tells you which problem it found. A literal percent sign should always be written as %25.

URL encoding vs Base64

Percent-encoding keeps text readable and only escapes what it must, which makes it the right choice for query strings and paths. Base64 turns any data, including binary files, into a compact string of 64 safe characters but makes it unreadable. Our guide on what Base64 encoding is and when to use it explains the trade-offs.

When a system expects Base64 rather than percent-encoding, for example in data URLs or HTTP Basic authentication headers, convert your text with the Base64 encoder and decoder instead.

Learn more

Frequently asked questions

Should I encode an entire URL or just the parameters?

Encode each parameter value with Component mode before joining it into the URL. Encoding a finished URL with Component mode would also escape the :// and / characters and break the link. Use Full URL mode only to clean up an address that is already assembled.

Why is a space sometimes %20 and sometimes +?

Both mean a space, but in different contexts. The URL standard uses %20 everywhere, while HTML form submissions and many query-string libraries use + inside the query part. Servers usually accept either in query strings, but only %20 is correct in the path.

Is URL encoding a form of encryption?

No. It only changes how characters are written so they can travel in a URL, and anyone can reverse it instantly. Never rely on it to hide passwords, tokens or personal data.

Why does decoding a JWT or Base64 string here give strange results?

Those formats are not percent-encoded, so there is usually nothing to decode. Paste a token into the JWT decoder to read its header and payload instead.

Is the text I enter sent to a server?

No. Encoding and decoding use your browser's built-in functions and run entirely on your device. Nothing you paste is uploaded or stored.

Related tools