URL Encoder and Decoder

Percent-encode text so it is safe inside a URL, or decode %20-style sequences back into readable text. You can encode a single value or a whole address, and the tool is free and runs in your browser.

URL Encoder and DecoderPrivate · runs on your device
Input
Words 0Characters 0Lines 0
Result

Example: a b&c → a%20b%26c

How to use the URL encoder and decoder

The three modes behave like the standard JavaScript functions, so results match what code produces.

  1. Paste your text or address into the Input box.
  2. Choose a Mode. Encode (component) is the default and suits one value, such as a search term. Encode (full URL) suits a complete address. Decode turns percent sequences back into text.
  3. When decoding, leave Treat + as space when decoding ticked for data from web forms, or untick it if plus signs are real plus signs.
  4. Read the output. If the percent sequences are broken, the note says Malformed percent-encoding and the output stays empty.
  5. Press Copy, Download .txt or Use as input.

Component mode is encodeURIComponent, full URL mode is encodeURI and decoding is decodeURIComponent. All three run on your device, so private addresses and tokens are not sent anywhere.

Component or full URL: what each leaves alone

Percent encoding replaces each unsafe byte with a percent sign and two hex digits of its UTF-8 value. A space is %20, & is %26, é is %C3%A9 and the euro sign is %E2%82%AC. Component mode escapes everything except letters, digits and - _ . ! ~ * ' ( ), so it also escapes the separators / ? # & = : +. Full URL mode additionally leaves those separators alone so the address keeps its shape.

ModeInput https://example.com/a b?q=x y&z=1#top gives
Componenthttps%3A%2F%2Fexample.com%2Fa%20b%3Fq%3Dx%20y%26z%3D1%23top
Full URLhttps://example.com/a%20b?q=x%20y&z=1#top

The component result is useless as a link, but exactly right as a value inside another URL, such as a redirect parameter. Note that component mode writes a plus sign as %2B, which is how you keep a literal plus in a query value such as a+b=c, encoded as a%2Bb%3Dc.

Decoding, plus signs and double encoding

In data sent by an HTML form, a space is often written as +, while in a URL path a plus is just a plus. That is what the checkbox decides: a%20b%26c+d decodes to a b&c d with it ticked and a b&c+d without.

A %2520 in a log is a space that was encoded twice, because the percent sign itself became %25. Decode once, press Use as input, and decode again. Full URL mode also escapes a bare % as %25, so running it over an address that is already encoded double-encodes it. The decoder expects UTF-8: a lone %E9 from a Latin-1 system fails with the malformed note, whereas %C3%A9 gives é. See exactly how those byte pairs are built in the UTF-8 encoder.

When you need it, and what it will not do

Typical jobs include building a link with a search term or a nested URL, preparing the subject and body of a mailto: link (the subject Hello world & more becomes Hello%20world%20%26%20more), reading encoded referrers in analytics, and debugging an API request. For campaign links, the UTM builder encodes the parameters for you, and the URL slug generator makes clean path segments instead of escaping them.

A short checklist helps. Encode each value once, as late as possible, and decode it once, as early as possible. Never encode a value and then paste it into a tool or library that encodes it again.

The tool encodes the whole input as one piece. It does not split a URL into scheme, path and query, does not convert international domain names, and is not a way to hide anything: percent encoding is public and reversible. To pack bytes into text rather than escape characters, use the Base64 encoder.

Escapes worth recognising on sight: %20 space, %22 quote, %23 hash, %25 percent, %26 ampersand, %2B plus, %2F slash, %3A colon, %3D equals, %3F question mark and %40 at sign. Hex digits in an escape may be upper or lower case, and this tool writes them in capitals.

Quick answers

Frequently asked questions

The questions people ask most, answered in plain words.

What does URL encoding do?

It replaces characters that are not allowed in a URL with a percent sign followed by two hex digits for each byte. A space becomes %20 and an ampersand %26. This lets any text, including other languages, travel inside a URL without breaking its structure.

Why are spaces %20 in a URL?

A space has the character code 32, which is 20 in hexadecimal, and percent encoding writes every escaped byte as a percent sign plus its two-digit hex value. HTML forms sometimes write spaces as a plus sign instead, which is a separate convention.

How do I decode a URL?

Set Mode to Decode and paste the encoded address or value. Each percent sequence is converted back to its byte and the bytes are read as UTF-8. If the text came from a web form, leave Treat + as space ticked so plus signs become spaces.

Should I encode the whole URL or just the parameters?

Encode only the values, using component mode. Encoding a whole address that way turns the colon and slashes into percent codes and breaks the link. If you must tidy a complete address, use full URL mode, which leaves the separators in place.

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes everything except letters, digits and a few marks, so it suits single values. encodeURI also leaves reserved characters such as slash, question mark and ampersand alone, so it suits complete URLs. This tool offers both as separate encode modes.