U
UseCalcForge Free Online Calculators
Developer Tools

URL Encoder / Decoder.

Percent-encode or decode a full URL or a single query parameter, with both handled separately.

Encoded

Decoded

Runs entirely in your browser. The values you enter never leave your device — there is no request to our server and nothing is stored. How we handle data

Why URLs Need Encoding

A URL can only contain a limited set of characters safely: letters, digits, and a handful of punctuation marks with defined structural meaning. Anything else — spaces, accented letters, symbols, or a structural character appearing as literal data — has to be represented as a percent sign followed by its byte value in hexadecimal.

Common Encodings

Space → %20
& → %26
/ → %2F
? → %3F
# → %23
+ → %2B

Encoding is reversible and lossless — decoding an encoded string always recovers the exact original bytes, which is what makes it safe to pass arbitrary data through a URL without corrupting it, however unusual the original characters were.

Component Encoding vs Full URI Encoding

These two modes exist because a full URL and a single value inside it need different characters left alone.

Single value / parameter — encodeURIComponent

Escapes everything that is not a plain letter, digit, or a small set of safe punctuation, including /, ?, &, and #. Use this for a value going into a query string, since those characters would otherwise be misread as part of the URL's own structure.

Full URL — encodeURI

Leaves structural characters like /, ?, #, and & alone, since a complete URL is expected to contain them as its own syntax. Use this when encoding an entire address rather than one piece of data inside it.

Using the wrong mode breaks the URL either way

Component-encoding a full URL turns its own slashes and colons into %2F and %3A, producing an unusable string. URI-encoding a single parameter value that happens to contain an & leaves it unescaped, silently splitting the query string at the wrong point.

Form Encoding and the Plus Sign

HTML forms submitted with the default application/x-www-form-urlencoded content type use a slightly different convention than standard URL percent-encoding: a space becomes a literal + rather than %20, and a literal + in the original data has to be escaped as %2B to avoid being read as a space.

This is a common source of confusion when debugging a query string built from form data versus one built directly by JavaScript's encoding functions, since the two conventions disagree on exactly one character. When decoding form-submitted data, replace + with a space before percent-decoding the rest, or use a decoder built specifically for form encoding rather than the general-purpose URL decoder.

Knowledge Base

URL Percent-Encoding Methodology.

Every URL is restricted to a small, safe character set by specification, and percent-encoding is the mechanism that lets arbitrary text — spaces, symbols, non-Latin characters, or a literal structural character used as data — travel through a URL intact and be recovered exactly on the other side.

The Calculation Branch

Percent-encoding: unsafe byte → % + two-digit hexadecimal value | encodeURIComponent escapes: space, &, /, ?, #, and other reserved characters | encodeURI leaves reserved URL-structure characters (/, ?, #, &) unescaped | Form encoding (x-www-form-urlencoded): space → +, literal + → %2B

Industrial Standards.

This tool uses the browser's native encodeURIComponent/decodeURIComponent and encodeURI/decodeURI functions directly, so the output matches exactly what JavaScript running anywhere else would produce for the same input and mode — no custom encoding logic that could diverge from the standard implementation. Decoding an invalid percent-encoded sequence (a stray % not followed by two valid hex digits) is caught and reported rather than silently producing corrupted output.

In-Depth Analysis & Reference Data

Percent-encoding operates on bytes, not characters directly, which is why a single accented or non-Latin character can expand into two or three %XX sequences once encoded — each byte of its UTF-8 representation gets its own percent-encoded triplet. A URL containing many non-ASCII characters can therefore look considerably longer once encoded than the original text.

Double-encoding — running already-encoded text through the encoder a second time — is a common bug, turning a literal % into %25 and producing a string that decodes to more encoded text rather than the original value. If a decoded result still contains %XX sequences, the input was likely encoded more than once.

Registry Questions & FAQ.

Why did decoding my input show an error?

A decode error means the text contains a % that is not followed by two valid hexadecimal digits, which is not valid percent-encoded data. This usually means the text was never encoded, or was corrupted, or contains a literal percent sign that itself needed encoding as %25.

Does this tool send my text anywhere?

No — encoding and decoding both run entirely in your browser using built-in JavaScript functions. Nothing you type here is transmitted or stored.

All metrics verified against ISO/ASTM benchmarks.