Skip to content

URL Encoder and Decoder

Mode
Encode as
Result
—
Percent escapes
—
Result length
—

To URL decode, replace each %XX with the byte it names and read the bytes as UTF-8; to encode, do the reverse for every character outside A–Z, a–z, 0–9 and – . _ ~. For example, café menu becomes caf%C3%A9%20menu, because é is the two bytes C3 A9 and a space is 20.

About this tool

Links break when a query value carries a space, an ampersand or a letter outside ASCII. This page percent-encodes text the way RFC 3986 describes and decodes it back. Encode mode offers three styles: a query value, where a space is %20 and even / ? & = are escaped; form data, where a space becomes + as an HTML form sends it; and a whole URL, which keeps the colon, slashes, ? and & so the link still opens. Decode mode turns %XX codes into readable text and can read + as a space. Each result shows how many percent escapes it holds. One limit: decoding assumes UTF-8, so very old links written in Latin-1 or Shift_JIS bytes are rejected rather than shown as garbled letters.

How to use it

  1. Choose Encode or Decode

    Encode turns plain text into %XX codes; Decode turns codes back into text.

  2. Paste or open your text

    Type into the box or open a .txt file; it is read in your browser and the result updates as you type.

  3. Pick the encoding style

    Query value for one parameter, Form data for + spaces, Whole URL to keep a full link working.

  4. Set the plus rule when decoding

    Leave 'Read + as a space' on for query strings; turn it off when a + means a real plus sign.

Examples

An accented capital A

Mode
Encode
Text to encode
À
Encode as
Query value

Result Result: %C3%80
Percent escapes: 2
Result length: 6

  1. Query value (RFC 3986): every character except A–Z a–z 0–9 – . _ ~ becomes UTF-8 bytes written as %XX; a space becomes %20.
  2. 2 percent escapes; 1 characters in, 6 out.

À is two bytes in UTF-8, C3 and 80, so it becomes two percent escapes.

A query string from a link

Mode
Decode
Encoded text or URL
caf%C3%A9+menu%3F
Read + as a space
Yes

Result Result: café menu?
Percent escapes: 3
Result length: 10

  1. Each + was read as a space first (form data rule).
  2. Each %XX was read as one byte and the bytes were read as UTF-8 text.
  3. 3 percent escapes; 17 characters in, 10 out.

The + is read as a space, %C3%A9 is the two UTF-8 bytes of é and %3F is a question mark.

A search phrase as form data

Mode
Encode
Text to encode
red shoes size 9
Encode as
Form data

Result Result: red+shoes+size+9
Percent escapes: 0
Result length: 16

  1. Form value: every character except A–Z a–z 0–9 – . _ ~ becomes UTF-8 bytes written as %XX, then each space (%20) is written as +.
  2. 0 percent escapes; 16 characters in, 16 out.

HTML forms send each space as a plus sign, which is how most search boxes put words in the address bar.

How it is calculated

encoded character = % + two hex digits for each UTF-8 byte (RFC 3986 §2.1); unreserved A–Z a–z 0–9 - . _ ~ stay as they are

Each character is first turned into its UTF-8 bytes: one byte for ASCII, two for é or À, three for most Chinese characters, four for an emoji. In Query value style every byte that is not an unreserved character is written as % plus two upper-case hex digits, so a space is %20 and & is %26; the characters ! ' ( ) * are escaped as well, which JavaScript's encodeURIComponent leaves alone. Form data applies the same rule and then writes %20 as +, following the WHATWG application/x-www-form-urlencoded serializer. Whole URL leaves the reserved delimiters : / ? # [ ] @ ! $ & ' ( ) * + , ; = untouched. Decoding reverses it: each %XX becomes a byte and the byte sequence must be valid UTF-8, otherwise the tool reports which part is broken.

Sources

Use from code or an AI agent Free API · MCP

The same calculation is a free JSON API. No key needed. The answer is in result.stats.primary.

curl -X POST https://api.tools-directory.workers.dev/v1/tools/url-encoder-and-decoder \
  -H 'Content-Type: application/json' \
  -d '{"inputs":{"mode":"encode","plain":"À","style":"component"}}'

When not to use it

  • Do not use it to hide data; percent-encoding is readable by anyone and is not encryption.
  • For binary files or images in a URL, use Base64 or a data URL instead.
  • Links in a legacy code page such as Windows-1252 will not decode, since UTF-8 is assumed.

Common mistakes

  • Encoding a whole link in Query value style turns https:// into https%3A%2F%2F and breaks it.
  • Encoding twice gives %2520 instead of %20; decode once more to recover the text.
  • Reading + as a space in a path, where + is a literal plus sign.
  • Leaving a bare % in a value; it must be written as %25.

Frequently asked questions

How do I URL decode a string?

Switch to Decode and paste the string. Every %XX pair is read as one byte, and the bytes are read as UTF-8, so %C3%A9 becomes é and %20 becomes a space. If the result still contains %25 or other codes, the string was encoded twice; paste the result back in and decode again.

How do I URL encode a space?

Inside a path or a query value, a space is %20, the hex code of byte 0x20. In form data sent by an HTML form, and in many search URLs, a space is written as + instead. Pick Query value for %20 or Form data for +; both decode back to the same space.

How do I URL encode and decode in JavaScript?

Use encodeURIComponent(value) for one query value and decodeURIComponent(text) to reverse it; encodeURI keeps the slashes and ? of a full link. Note that encodeURIComponent leaves ! ' ( ) * alone, while this page escapes them as RFC 3986 suggests. URLSearchParams writes spaces as +, like the Form data style here.

How do I URL encode and decode in Python?

Import urllib.parse. quote(text, safe='') gives the Query value result, quoteplus(text) gives the Form data result with + for spaces, and unquote or unquoteplus reverse them. By default quote keeps / unescaped, so pass safe='' when encoding a single parameter.

How do I URL encode in Java?

java.net.URLEncoder.encode(text, StandardCharsets.UTF8) follows the form rule, so spaces become + and * stays as it is. For %20 spaces, replace + with %20 in the output, or build the link with java.net.URI. URLDecoder.decode(text, StandardCharsets.UTF8) reverses it and treats + as a space.

What does %3D mean in a URL decode?

%3D is the byte 0x3D, the equals sign. It shows up when a value itself contains = so that it is not mistaken for the separator between a parameter name and its value; Base64 tokens ending in == often appear as %3D%3D.

Cite this tool

Using this tool in an assignment, article or report? Copy a citation, or a link for your website.

APA

Tools Directory Editorial Team. (2026, December 3). URL Encoder and Decoder. Tools Directory. Retrieved December 4, 2026, from https://directory.milunir.com/developer-tools/encoders-decoders/url-encoder-and-decoder/

MLA

Tools Directory Editorial Team. “URL Encoder and Decoder.” Tools Directory, 3 Dec. 2026, https://directory.milunir.com/developer-tools/encoders-decoders/url-encoder-and-decoder/. Accessed 4 Dec. 2026.

Chicago

Tools Directory Editorial Team. “URL Encoder and Decoder.” Tools Directory. Last modified December 3, 2026. Accessed December 4, 2026. https://directory.milunir.com/developer-tools/encoders-decoders/url-encoder-and-decoder/.

Link<a href="https://directory.milunir.com/developer-tools/encoders-decoders/url-encoder-and-decoder/">URL Encoder and Decoder – Tools Directory</a>