URL Encoder / Decoder

Use our free URL Encoder & Decoder to encode or decode URLs instantly. Convert special characters into percent-encoded format for safe web transmission.

URL Encoder / Decoder
URL to Encode
Encoded result
📋 try examples:
Did you know? URL encoding replaces spaces with %20 or +

User Guide

1

Choose a direction

Encode URL converts unsafe characters into percent codes. Decode URL converts them back into readable text.

2

Paste your text

Encode the value rather than the whole address — a search term, an email address, a redirect target. Encoding a complete URL will escape its own slashes and colons and break it.

3

Press Process

Encoding turns a space into %20, an @ into %40 and so on. The example chips demonstrate a URL with spaces, a complex address and a mailto link with umlauts.

4

Use Swap to check your work

The swap button moves the output back to the input, so you can decode what you just encoded and confirm it round-trips to exactly what you started with.

5

Watch for double encoding

If you see %2520, something was encoded twice — the % of %20 became %25. Decode once and check before encoding again.

6

Non-English text is handled

Characters outside ASCII are converted to UTF-8 first, so accented letters, Cyrillic, Chinese and emoji all encode correctly and reverse cleanly.

About the URL Encoder and Decoder

URLs may only contain a restricted set of ASCII characters. Everything else — spaces, accents, emoji, and any character that has a structural role — must be percent-encoded. This tool converts in both directions, in your browser.

How percent-encoding works

Each disallowed byte becomes a % followed by its two-digit hexadecimal value. A space is byte 0x20, so it becomes %20. Characters outside ASCII are converted to UTF-8 first and then encoded byte by byte, which is why an accented letter can produce two or more percent groups.

Character Encoded Why it needs encoding
space %20 Terminates the URL in many parsers
& %26 Separates query parameters
= %3D Separates a parameter name from its value
? %3F Begins the query string
# %23 Begins the fragment
/ %2F Separates path segments
+ %2B Read as a space in form encoding
é %C3%A9 Outside ASCII — two UTF-8 bytes

RFC 3986 divides characters into reserved ones that carry structural meaning and unreserved ones (letters, digits, hyphen, full stop, underscore and tilde) that never need encoding. The reserved set is the interesting part: those characters are legal in a URL, but only where they are meant to do their job.

The mistake almost everyone makes

Encode the value, not the whole URL.

Paste an entire address in and the tool will faithfully escape its colons and slashes, turning https://example.com/ into https%3A%2F%2Fexample.com%2F — no longer a working link.

Encode the individual piece being placed into a URL. Building a search link for cafés & bars means encoding just that phrase to caf%C3%A9s%20%26%20bars and assembling https://example.com/search?q=caf%C3%A9s%20%26%20bars. Without it, the & would start a new parameter and the query would silently truncate to cafés.

This is the distinction JavaScript draws between encodeURI, which preserves structural characters, and encodeURIComponent, which escapes them because it assumes the input is a single value. This tool applies the latter — see the MDN encodeURIComponent reference. It is the right choice for query parameters, which is what people actually need.

Double encoding

A frequent and confusing bug. Encoding hello world gives hello%20world. Encode that again and the % is itself escaped, producing hello%2520world. The server decodes once and receives the literal text hello%20world.

The signature is a %25 where a plain percent code should be. It usually means both a framework and your own code encoded the same value. Decode until the string stops changing, then encode exactly once.

Plus signs and spaces

Two conventions coexist. Percent-encoding proper uses %20 for a space. HTML form submissions use application/x-www-form-urlencoded, which uses + instead. Both appear in the wild, and both are correct in their own context.

The practical consequence: a literal plus sign in data — in user+tag@example.com, say — must be encoded as %2B, or it will be read as a space and the address will break. This is a common cause of failed email sign-ups.

Privacy

Everything runs in JavaScript inside this page. Nothing you type is transmitted, logged or stored.

Frequently Asked Questions

Should I encode the whole URL or just part of it?

Just the value. Encoding a complete address escapes its own colons and slashes and breaks the link. Encode the individual piece — a search term, an email address, a redirect target — then assemble the URL around it.

What does %2520 mean?

Double encoding. A space becomes %20, and encoding that again escapes the percent itself to give %2520. It usually happens when a framework and your own code both encode the same value. Decode until the string stops changing, then encode once.

Why is a space sometimes %20 and sometimes a plus sign?

Two conventions. Percent-encoding proper uses %20; HTML form submissions use the x-www-form-urlencoded format, which uses +. Both are correct in context. A literal plus in your data must be encoded as %2B or it will be read as a space.

Why does my email address break in a URL?

Usually a plus sign. In an address like user+tag@example.com the plus is read as a space unless encoded as %2B. The @ also needs encoding as %40 when it appears in a query parameter value.

Which characters do not need encoding?

The unreserved set from RFC 3986: A–Z, a–z, 0–9, hyphen, full stop, underscore and tilde. Everything else either carries structural meaning or falls outside ASCII, and should be encoded when used as a value.

Does this handle non-English characters?

Yes. Text outside ASCII is converted to UTF-8 and then encoded byte by byte, so an accented letter becomes two percent groups — é is %C3%A9. Cyrillic, Chinese and emoji all encode and reverse correctly.

What is the difference between encodeURI and encodeURIComponent?

encodeURI preserves structural characters such as : / ? and &, so it is for whole URLs. encodeURIComponent escapes them, because it treats the input as a single value. This tool uses the latter, which is what query parameters need.

Does anything I paste leave my browser?

No. Encoding and decoding run in JavaScript inside this page. Nothing you paste is transmitted or stored, which matters when the value contains an email address, a token or a customer identifier.