URL Encode / Decode

Type text and a mode. hello world gives hello%20world. a b+c gives a%20b%2Bc. %20%2B in decode gives space and plus. encodeURIComponent, not a form plus.

encodeURIComponent / decodeURIComponent. Space is %20, not +. A code point sits on ASCII / Unicode.

Input data

Results

Enter data and click Calculate.

How it works

URL Encode / Decode in this calculator encodes the typed text. hello world gives hello%20world. a b+c gives a%20b%2Bc. %20%2B in decode gives a space and a plus. Extras keep those encoded strings. This is encodeURIComponent, not application/x-www-form-urlencoded.

Field url-str is text. Mode url-mode in the first two extras is encode, in the third decode. A space becomes %20. A plus becomes %2B. Decode of %20%2B returns a space and a plus.

hello%20world is not a PHP query. a%20b%2Bc does not treat plus as space. You type the string. The calculator does not call a server.

ASCII / Unicode next door reads A as 65. Base64 size estimates length. Here hello world stays hello%20world.

Type hello world and encode, then Calculate. The result is hello%20world. A blank field encodes nothing. This is not form +.

hello world gives hello%20world. a b+c gives a%20b%2Bc. %20%2B in decode gives a space and a plus. Another string changes hello%20world.

Formula

encode = encodeURIComponent(text); decode = decodeURIComponent(text). Space is %20, not +.

How to use

  1. Type hello world and mode encode.
  2. Click Calculate. The result is hello%20world.
  3. a b+c gives a%20b%2Bc. %20%2B in decode gives a space and a plus.
  4. encodeURIComponent, not a form plus.
  5. A code point sits on ASCII / Unicode.

hello world = hello%20world

encodeURIComponent. hello world gives hello%20world. Not form +.

URL
Percent-encoding. hello world leaves hello%20world. Not a PHP query.
Encode
The url-mode value. a b+c gives a%20b%2Bc. Space is %20.
Decode
The third extras. %20%2B returns a space and a plus.

Examples

Example 1

  • hello world
  • encode

hello%20world

What about hello world in encode? hello%20world. encodeURIComponent, not form +.

Example 2

  • a b+c
  • encode

a%20b%2Bc

What about a b+c? a%20b%2Bc.

Example 3

  • %20%2B
  • decode

+

What about %20%2B in decode? A space and a plus.

Related calculators

Common questions

What about hello world in encode?

hello%20world. encodeURIComponent. Space is %20, not +.

What about a b+c?

a%20b%2Bc. Plus also becomes %2B.

What about %20%2B in decode?

A space and a plus. Decode from percent-encoding.

Does space become a plus?

No. This is not application/x-www-form-urlencoded. Space is %20.

Does the calculator call a server?

No. encodeURIComponent in the browser. No request.

Does double-encoding %2520 count?

Yes as text. The calculator does not guess whether you already pasted %25.

Does a blank field encode?

No. Without text there is no hello%20world.

Where is the code point for A?

On ASCII / Unicode, result 65. Here hello%20world stays.

Is + in decode a space?

No. + stays a plus. Space enters as %20.

Knowledge sources

The calculator counts bits, bytes or throughput from your numbers. Below are SI and bit definitions (NIST).

Page updated in 2026.

What URL encoding (percent-encoding) means

A URL can safely carry a limited ASCII set. Everything else β€” spaces, non-ASCII letters, reserved symbols β€” is written as percent-encoding: % plus two hex digits (a UTF-8 byte or other, depending on context). Example: space β†’ %20, Γ© in UTF-8 β†’ %C3%A9.

This calculator follows semantics close to JavaScript encodeURIComponent / decodeURIComponent: it encodes characters that are unsafe in a URI component (parameter value, path segment), and decodes %HH sequences back to text.

Which characters usually need encoding

  • URI reserved: :/?#[]@!$&'()*+,;= β€” inside a parameter value they often must be encoded or they change URL structure.
  • Spaces and controls β€” always encode in query/path components.
  • Unicode (accents, €, emoji) β€” as UTF-8 percent-encoded byte sequences.
  • Typically safe in encodeURIComponent: A–Z a–z, digits, - _ . ! ~ * ' ( ) β€” details vary by API; do not assume identity with encodeURI.

Space: %20 vs plus (+)

  • %20 β€” universal percent-encoding for space (path, query, most APIs).
  • + β€” in application/x-www-form-urlencoded (classic HTML forms), space is often a plus in the query string.
  • encodeURIComponent('a b') β†’ a%20b (not plus). Treating bare + as space is a form-encoding rule, not plain URI-component decoding.

If an API expects form-urlencoded, read the docs β€” mixing %20 and + is a common integration bug.

Encoding vs decoding

  • Encode β€” user text / parameter β†’ safe URL fragment.
  • Decode β€” %HH from logs, OAuth callbacks, copy-paste β†’ readable text.
  • Encoding is not encryption: anyone can decode it. It does not protect secrets.
  • Invalid % sequences (e.g. %ZZ, truncated %C3) fail decoding β€” the calculator reports that.

Path vs query string

  • Query (?q=...) β€” encode each value with a component encoder, then join pairs with & / =.
  • Path β€” keep structural slashes; encode odd characters inside segments. encodeURI (whole URL) preserves more reserved characters than encodeURIComponent.
  • Fragment (#...) β€” do not encode the opening #; encode fragment content as your app requires.

Bad practice: run encodeURIComponent on a full https:// URL for the address bar β€” you get a useless blob (unless you intentionally pass a URL as a parameter value).

Common mistakes and double-encoding

  • Double-encode: a b β†’ a%20b β†’ again β†’ a%2520b. Symptom in logs: %25.
  • Encoding an already-built query including & β€” breaks parameter structure.
  • Decoding β€œjust in case” repeatedly β€” can corrupt data that legally contains %.
  • Confusing Base64 with percent-encoding β€” different alphabets and purposes.
  • Copying UI pluses into a context that expects %20.

Worked examples

  • hello world β†’ hello%20world
  • a&b=c (as a value) β†’ a%26b%3Dc
  • cafΓ© β†’ caf%C3%A9 (UTF-8)
  • 100% sure β†’ 100%25%20sure (% must be encoded too)
  • Decode a%2520b once β†’ a%20b; twice β†’ a b (undoing double-encode on purpose)

Paste your own string into the form β€” copy the result into an HTTP request or API docs.

Quick encoding table (encodeURIComponent)

Common characters and strings β€” semantics close to encodeURIComponent in this calculator.

InputEncodedNote
space%20not plus (+) as in form-urlencoded
@%40common in emails inside query values
/%2Finside a parameter value, not as a path separator
?%3Fotherwise starts a new query
hello worldhello%20worldsimple smoke test
email@example.comemail%40example.comwhole address as a value

Safe URL-building workflow

  • Build the base URL with fixed parts (https://api.example.com/v1/search).
  • Encode each parameter value separately (this calculator / encodeURIComponent).
  • Join ?k= + encoded + & + more pairs β€” do not encode the finished query a second time.
  • When debugging: if logs show %2520, decode once and find which layer over-encodes (frontend, gateway, SDK).
  • Regression tests: space, &, %, emoji, empty string, already-encoded input.

Full query example: search phrase shoes & bags β†’ value shoes%20%26%20bags β†’ URL .../search?q=shoes%20%26%20bags.