ToolNimba Browse

🔗 URL Encoder and Decoder

By ToolNimba Editorial Team · Updated 2026-06-19

Type above to see the encoded output.

This URL encoder and decoder converts text to percent-encoding and back. Switch the toggle to encode plain text into a safe URL form, or paste an encoded string to decode it back to readable text. Everything runs in your browser, so the values you type never leave your device, and you can copy the result with one click.

What is the URL Encoder Decoder?

A URL can only contain a limited set of characters. Letters, digits, and a handful of symbols are safe, but anything else (spaces, ampersands, question marks, accented letters, emoji) has to be escaped before it can travel safely inside a web address. Percent-encoding is the mechanism for that. Each unsafe character is replaced by a percent sign followed by the two-digit hexadecimal code of its byte, so a space becomes %20 and an ampersand becomes %26.

This tool encodes using the browser built-in encodeURIComponent and decodes using decodeURIComponent. encodeURIComponent is the right choice when you are encoding a single value, such as a query string parameter, because it escapes reserved characters like &, =, ?, and / that would otherwise be read as URL structure. Non-ASCII characters are first converted to their UTF-8 bytes and then each byte is percent-encoded, which is why an accented letter like é turns into two percent groups (%C3%A9).

When decoding, the tool also treats a plus sign as a space before decoding, because older form submissions encode spaces as +. A percent sign in the input must be followed by two valid hexadecimal digits, otherwise the string is not valid percent-encoding and cannot be decoded. If you paste something malformed, the tool tells you instead of guessing.

When to use it

  • Building a query string by hand and needing to escape a value that contains spaces, ampersands, or equals signs.
  • Decoding a long URL from an email or log file so you can read the parameters it carries.
  • Preparing text for a mailto link, an API request, or a redirect parameter so it does not break the surrounding URL.

How to use the URL Encoder Decoder

  1. Choose Encode to turn plain text into percent-encoding, or Decode to turn percent-encoding back into text.
  2. Type or paste your text into the top box.
  3. Read the converted result in the bottom box, which updates as you type.
  4. Click Copy to put the result on your clipboard.

Formula & method

Each unsafe byte becomes %XX, where XX is the two-digit uppercase hexadecimal value of that byte. Non-ASCII characters are encoded as their UTF-8 bytes first.

Worked examples

Encoding the search phrase "John & Jane" for a query parameter.

  1. The space becomes %20.
  2. The ampersand & becomes %26 so it is not read as a parameter separator.
  3. Letters stay as they are.

Result: John%20%26%20Jane

Encoding the value "a/b?c=d" with encodeURIComponent.

  1. The slash / becomes %2F.
  2. The question mark ? becomes %3F.
  3. The equals sign = becomes %3D.

Result: a%2Fb%3Fc%3Dd

Decoding the encoded string "caf%C3%A9" back to text.

  1. %C3%A9 is the UTF-8 byte pair for the character é.
  2. The plain letters c, a, f are left as they are.
  3. The bytes are reassembled into the original character.

Result: café

Common characters and their percent-encoded form

CharacterNameEncoded
(space)Space%20
&Ampersand%26
=Equals%3D
?Question mark%3F
/Slash%2F
#Hash%23
+Plus%2B
ée with acute accent%C3%A9

encodeURIComponent versus encodeURI

FunctionBest forEscapes & = ? /
encodeURIComponentA single value, such as one query parameterYes
encodeURIA whole URL where structure must stay intactNo

Common mistakes to avoid

  • Encoding a whole URL with encodeURIComponent. encodeURIComponent escapes :, /, ?, and & as well, which breaks a full address. Use it on individual values, and encode the complete URL only when you intend to pass the whole thing as one parameter.
  • Double-encoding a value. Encoding text that is already encoded turns %20 into %2520, because the % itself gets escaped. Decode first if you are unsure whether a string was already encoded.
  • Forgetting that + means space in query strings. Form submissions often encode spaces as +. A raw decode leaves the plus in place, so this tool converts + to a space before decoding to match that convention.

Glossary

Percent-encoding
A way of representing unsafe characters in a URL as a percent sign followed by two hexadecimal digits, for example %20 for a space.
Reserved characters
Characters such as / ? & = and # that have a special meaning in a URL and must be encoded when used inside a value.
UTF-8
The character encoding that turns each character into one or more bytes. Non-ASCII characters become several bytes, each encoded as its own percent group.
Query string
The part of a URL after the question mark, made of key=value pairs joined by ampersands, where values usually need encoding.

Frequently asked questions

What is URL encoding?

URL encoding, also called percent-encoding, replaces characters that are unsafe in a web address with a percent sign and two hexadecimal digits. For example a space becomes %20 and an ampersand becomes %26, so the URL stays valid.

How do I decode a URL?

Switch this tool to Decode and paste the encoded string. It converts each percent group back to its original character. The string must use valid percent-encoding, meaning every % is followed by two hexadecimal digits.

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes reserved characters like &, =, ?, and /, which makes it right for a single value such as one query parameter. encodeURI leaves those structural characters alone so a complete URL stays usable. This tool uses encodeURIComponent.

Why does a space become %20 sometimes and + other times?

Percent-encoding represents a space as %20. The older application/x-www-form-urlencoded format used in HTML form submissions encodes a space as +. When decoding, this tool treats + as a space so both conventions work.

Why does é become %C3%A9 instead of one code?

Non-ASCII characters are first turned into their UTF-8 bytes, then each byte is percent-encoded. The letter é is two bytes in UTF-8, so it appears as two percent groups, %C3 and %A9.

Is this URL encoder safe to use with private data?

Yes. All encoding and decoding happens locally in your browser using built-in JavaScript functions. Nothing you type is sent to a server, so your URLs and values stay on your own device.