Skip to content

URL Encoder / Decoder

Percent-encode or decode URLs and query strings.

Runs entirely in your browser. Nothing you type is sent to a server.
Running locallyDeveloper Tools
Encoded output
Your result will appear here.
Short answer

This percent-encodes and decodes URL components in your browser. Percent-encoding replaces characters that have structural meaning in a URL — or that cannot appear in one at all — with a % followed by their hexadecimal byte value, so a space becomes %20 and an ampersand becomes %26. Getting this right is what stops a query parameter containing an & from silently splitting into two parameters. The distinction that causes most bugs is component versus whole-URL encoding: encodeURIComponent escapes : / ? # & = because inside a parameter value they are data, while encodeURI leaves them alone because across a full URL they are structure. Encoding a whole URL with the component function produces https%3A%2F%2F and a broken link. Non-ASCII characters are encoded as their UTF-8 bytes, so é becomes %C3%A9 — two bytes, two escapes. Encoding twice turns % into %25 and is rarely intended.

Overview

About the URL Encoder / Decoder

Percent-encode any URL, query parameter, or text for safe use in links and APIs — or decode an encoded URL back into readable form. The tool is Unicode-safe and runs entirely in your browser using the standard encodeURIComponent / decodeURIComponent APIs.

Procedure4

How to use the URL Encoder / Decoder

  1. 01Pick a mode: Encode (text → percent-encoded) or Decode (percent-encoded → text).
  2. 02Paste your input into the editor.
  3. 03See the converted output update live below.
  4. 04Click "Copy" to grab the result for your URL or API call.
Capabilities4

Why use our URL Encoder / Decoder

  • 01

    Two-way conversion

    Switch instantly between encoding and decoding with a single toggle.

  • 02

    Unicode-safe

    Built on encodeURIComponent / decodeURIComponent — handles every UTF-8 character correctly.

  • 03

    Error-tolerant decoding

    Malformed percent-escapes show a clear error instead of failing silently.

  • 04

    Completely private

    Conversion happens locally — your URLs and data are never uploaded.

Detail

Which characters need to be URL encoded?

A URL's structure is defined by a small set of characters that act as delimiters: the colon separating scheme from the rest, the slash separating path segments, the question mark introducing the query, the ampersand separating parameters, the equals sign joining a key to its value, and the hash introducing a fragment. When one of those characters appears inside a value rather than as a delimiter, it must be encoded or the URL will be parsed wrongly. A search for 'cats & dogs' passed unencoded produces a query the server reads as two parameters, the second of which is meaningless. A redirect target containing a query string, passed unencoded as a parameter, loses everything after its own question mark. These are not theoretical: they are among the most common integration bugs, and they usually appear as data mysteriously truncating at a punctuation mark.

Detail

encodeURI versus encodeURIComponent

JavaScript provides two functions and choosing wrongly is the single most frequent mistake in this area. encodeURI is intended for a complete URL and deliberately leaves the delimiter characters alone, because encoding them would destroy the URL's structure — it will not touch : / ? & = # or several others. encodeURIComponent is intended for a single value being placed into a URL and encodes everything that is not unreserved, including all the delimiters. The rule is simple once stated: use encodeURIComponent for each parameter name and value individually, and encodeURI only when you have an entire URL that needs its spaces and non-ASCII characters cleaned up. Using encodeURI on a parameter value is the classic bug, because it leaves an embedded & intact and the parameter splits. Note also that neither encodes the plus sign, which HTML form submissions interpret as a space — if a value contains a literal plus, it must be encoded as %2B explicitly.

Detail

Unicode, double encoding and the plus-sign problem

Non-ASCII characters are encoded by first converting to UTF-8 and then percent-encoding each byte, so é becomes %C3%A9 — two bytes, two escapes. This is why encoded URLs containing accented or non-Latin text look so long. Double encoding is the other recurring failure: encoding an already-encoded string turns %20 into %2520, because the percent sign itself gets encoded. The symptom is a URL that displays literal %20 sequences in a page, and the cause is almost always two layers of code each helpfully encoding the same value. The fix is to establish exactly one place where encoding happens. Finally, the plus sign is genuinely ambiguous: in the path portion it is a literal plus, while in a query string form encoding treats it as a space. That inconsistency is a legacy of early HTML form behaviour, and it means a value containing a plus — a phone number in international format, for instance — must be explicitly encoded as %2B to survive.

Reference8

Frequently encoded characters

CharacterEncodedWhy it matters
space%20Cannot appear literally in a URL
&%26Otherwise splits into a new parameter
=%3DOtherwise read as a key/value separator
?%3FOtherwise starts the query string
#%23Otherwise starts the fragment
/%2FOtherwise read as a path separator
+%2BOtherwise read as a space in query strings
é%C3%A9UTF-8 encoded as two bytes

Use encodeURIComponent for individual values; encodeURI only for a whole URL.

Questions9

Frequently asked questions

What is percent-encoding?

Replacing a character with % followed by its hexadecimal byte value, so that characters with structural meaning in a URL can appear safely inside a value.

What is the difference between encodeURI and encodeURIComponent?

encodeURI is for a whole URL and leaves delimiters like : / ? & = # intact. encodeURIComponent is for a single value and encodes them too. Use the latter for parameters.

Why does my parameter get cut off?

It almost certainly contains an unencoded & or #, which the parser reads as the start of a new parameter or fragment. Encode the value with encodeURIComponent.

Why do I see %2520 in my URL?

Double encoding. An already-encoded string was encoded again, turning the % of %20 into %25. Find the two places doing it and remove one.

Why is é encoded as two escapes?

Non-ASCII characters are converted to UTF-8 first and then each byte is escaped. é is two bytes in UTF-8, so it becomes %C3%A9.

Is a plus sign a space?

In a query string, form encoding treats + as a space. In the path it is a literal plus. A genuine plus in a value must be encoded as %2B.

Do I need to encode a whole URL?

Rarely. Encode each parameter value as you build the URL. Encoding the finished URL usually either does nothing useful or breaks its structure.

Are unreserved characters ever encoded?

They do not need to be. Letters, digits, hyphen, full stop, underscore and tilde are unreserved and safe to use literally.

Is my input uploaded?

No. Encoding and decoding happen entirely in your browser.

Last updated

URI syntax and percent-encoding per RFC 3986. Form encoding behaviour of the plus sign follows the HTML specification's application/x-www-form-urlencoded serialisation.