CalcSeed

URL Encoder Decoder Calculator

Enter text to percent-encode it for a URL, or switch to decode to turn an encoded string back into plain text.

Result
—

Why URLs need encoding

A URL can only carry a small alphabet safely: letters, digits and a handful of punctuation marks. Everything else — spaces, ampersands, question marks, non-English characters — would either break the URL structure or be misread as a delimiter. Percent-encoding solves this by replacing each unsafe character with a percent sign followed by two hexadecimal digits representing its byte value, per RFC 3986. The space in "Hello world" becomes %20, and the ampersand becomes %26, because an unencoded & would signal the start of a new query parameter.

%h1h2→byte%h1h2 -> byte

The encoding operates on bytes, not characters, which matters for anything outside ASCII. This tool uses encodeURIComponent semantics, so each character is first converted to its UTF-8 bytes and each byte is percent-encoded separately. That is why accented letters and CJK characters expand to 3 hex-digit pairs and most emoji to 6.

Worked example at the default input

The default text "Hello world & more!" encodes to Hello%20world%20%26%20more!. The two spaces become %20 and the ampersand becomes %26. The exclamation mark stays as-is, because this encoder treats the seven characters — hyphen, underscore, period, exclamation mark, tilde, asterisk and apostrophe — plus parentheses as safe. Run the result back through decode mode and you recover the original string exactly.

Multi-byte input shows the byte-level behavior clearly. "café" encodes to caf%C3%A9, because é is the two UTF-8 bytes C3 A9. A CJK ideograph encodes to three pairs such as %E4%B8%AD, and an emoji like the grinning face becomes %F0%9F%98%80 — four bytes, each written as its own %XX pair. Decoding reverses this precisely, reassembling the bytes and reading them back as UTF-8.

What each reserved character encodes to

CharacterEncodedWhy it is reserved
space%20Delimits tokens in URLs and forms
&%26Separates query parameters
=%3DSeparates keys from values
?%3FStarts the query string
#%23Starts the fragment identifier
/%2FSeparates path segments
:%3ASeparates scheme, host and port
+%2BMeans space in form encoding, so it must be escaped here
%%25Introduces every escape sequence, including itself

The % row is the bootstrapping rule: since every escape starts with %, a literal percent sign must encode itself to %25 first. This is also the source of the classic double-encoding bug — encoding an already-encoded string turns %20 into %2520, and decoding it once still leaves %20 in the text.

Encode versus decode mode

Encode mode takes plain text and emits a URL-safe string. Decode mode does the reverse: it scans for % sequences, converts each pair of hex digits back to a byte, and interprets the byte stream as UTF-8 to rebuild the original characters. Decode is what you want when reading query parameters out of logs, reconstructing a value pasted from a browser address bar, or inspecting what an encoded JSON payload actually contains.

When decoding fails

Decoding is strict. A percent sign that is not followed by two valid hex digits — a bare 100% or a truncated %E0%A4%A — produces a URI malformed error rather than a best-effort guess. The error protects you: silently accepting a broken sequence would corrupt whatever text follows it. If a string fails to decode, look for a stray % that should have been %25.

Common mistakes and edge cases

  • Double-encoding: running an encoded string through encode again turns %20 into %2520 and breaks the link
  • Confusing + with %20 — the plus form belongs to application/x-www-form-urlencoded, used by HTML forms; this tool always emits %20
  • Encoding a whole URL instead of just the value: encoding https://example.com destroys the : and / structure it needs
  • Encoding each part twice in a template literal, once by hand and once by the framework, which produces %2520 bugs in production
  • Assuming case matters: %2F and %2f are identical, since hex digits are case-insensitive

encodeURI versus encodeURIComponent

JavaScript offers two encoders, and picking the wrong one causes subtle bugs. encodeURI preserves the structural characters of a complete URL — it leaves ://?& alone — so it is for encoding a full address. encodeURIComponent escapes everything except pure text characters, so it is the right choice for encoding a single query value that will be embedded into a URL later. This calculator implements the component-level behavior, which is the one nearly every developer needs when building query strings.

Where percent-encoding shows up

Query strings are the obvious home, but the same grammar governs path segments, fragment values and even OAuth tokens pasted into URLs. When a tracking parameter contains spaces from a form field, or a filename with an ampersand is linked directly, the encoded form is what keeps the URL parsable. For converting whole byte payloads rather than text values, the Base64 Encoder Decoder is the sibling tool, and the ASCII Table shows the byte values behind each hex pair.

Frequently asked questions

What is a space encoded as in a URL?

%20. A plus sign also means space in HTML form encoding, but the two are different schemes — this tool uses the RFC 3986 form, so Hello world becomes Hello%20world.

What does "Hello world & more!" encode to?

Hello%20world%20%26%20more!. The two spaces become %20 and the ampersand becomes %26, while letters and the exclamation mark pass through unchanged.

Why does my accented character turn into two escapes?

Encoding works on UTF-8 bytes, and characters above U+007F need more than one byte. É is the 2-byte sequence C3 89, so it becomes %C3%89; a lowercase é is C3 A9, and a CJK character needs 3 bytes.

Why does decoding fail with a bare percent sign?

A % must be followed by exactly two hex digits. A literal percent such as in 100% is invalid, and the correct encoding is 100%25. The tool reports URI malformed instead of guessing.

Is URL encoding the same as Base64?

No. Percent-encoding escapes unsafe characters and keeps readable text readable, while Base64 rewrites every byte into a 64-symbol alphabet and grows data by about 33%. They solve different problems.

Should I encode a full URL or just its parts?

Just the parts. Encoding a whole URL escapes the : / ? characters that make it a URL. Encode each query value separately with component-level encoding, then join them with &.

Why is %2520 showing up in my URL?

That is double-encoding: an already-encoded %20 was encoded again, turning % into %25. Decode once to get %20 back, and remove the extra encode call in your code to fix it permanently.

Are encoded characters case-sensitive?

The hex digits are not — %2F and %2f decode identically. The surrounding text is case-sensitive, but the escape mechanism itself treats A and a in a hex pair as the same value.

How much longer does encoded text get?

It depends on content: pure ASCII text with no reserved characters stays the same length, each space or ampersand triples to 3 characters, and non-ASCII characters expand to 9 characters per byte triple. An emoji grows from 2 UTF-16 units to 12 encoded characters.

Method and sources

Calculation basis

Conversions and formats follow the relevant IETF RFCs and IEEE standards, including RFC 4648 for Base64 and RFC 791 for IPv4 addressing.

Last updated: November 17, 2026
Formula & data sources
  • RFC 3986: Uniform Resource Identifier (URI) generic syntax.

Cite this page

Reference formats
APA 7CalcSeed. (2026, November 17). URL Encoder Decoder Calculator. https://calcseed.com/c/developer/url-encoder-decoder-calculator/
MLA 9"URL Encoder Decoder Calculator." CalcSeed, 17 Nov. 2026, calcseed.com/c/developer/url-encoder-decoder-calculator/.
ChicagoCalcSeed. "URL Encoder Decoder Calculator." Last modified November 17, 2026. https://calcseed.com/c/developer/url-encoder-decoder-calculator/

Related calculators

People also calculate