ToolGenie.org Logo

URL Encoder & Decoder

Percent-encode text for safe use in URLs, or decode an escaped URL back into readable characters.

Escapes reserved characters such as ? & = / # so the value is safe inside a single query parameter.

How to Use the URL Encoder & Decoder

  1. Paste the value you want to percent-encode, or paste an already escaped URL you want to read back.
  2. Pick a mode: "Component" for a single query value or path segment, "Full URL" when you are escaping a complete address.
  3. Click "Encode" to produce the percent-encoded string, or "Decode" to turn %XX sequences back into characters.
  4. Check the result panel — the heading tells you whether you are looking at encoded or decoded output.
  5. Use "Copy result" to grab the output, or "Clear" to start a new conversion.

What Is URL Encoding and Decoding?

URLs are only allowed to carry a small set of characters. Everything else — spaces, accents, ampersands, slashes inside a value — has to be replaced by a percent sign followed by the hexadecimal value of each UTF-8 byte. That substitution is called percent encoding, and it is why a space becomes %20 and an em dash becomes %E2%80%94.

The two modes here map directly onto the two JavaScript functions developers reach for. Component mode uses encodeURIComponent, which escapes the reserved delimiters ? & = / # : and is what you want for a single query-string value. Full URL mode uses encodeURI, which leaves the structure of an address alone and only escapes characters that are never legal anywhere in a URL. Decoding mirrors the same split, and a lone percent sign or a truncated sequence such as %E2 raises a readable error instead of a silent wrong answer.

Escaping content for a web page rather than a link? The HTML entity encoder and decoder handles angle brackets and quotes. For binary-safe payloads reach for the Base64 encoder and decoder, and inspect awkward query strings alongside the JSON formatter.

Frequently Asked Questions (FAQ)

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes the reserved characters that separate parts of a URL, including ? & = / # and :, so the result is safe as a single query value. encodeURI leaves those delimiters intact because it assumes you are handing it a whole address.

How do I encode a URL online?

Paste the text into the input box, leave the mode on "Component" if you are encoding one parameter value, and click "Encode". The percent-encoded string appears immediately and can be copied with one click.

How do I decode a URL string with %20 in it?

Paste the escaped string and click "Decode". Every %XX sequence is converted back to the character it represents, so %20 becomes a space and %E2%9C%93 becomes a check mark.

Why does my URL fail to decode?

Decoding fails when a percent sign is not followed by two valid hex digits, or when the bytes do not form valid UTF-8. A stray % in free text and a truncated sequence such as %E2 are the two most common causes.

Does URL encoding convert a space to + or %20?

This tool always produces %20, which is correct everywhere in a URL. The plus sign is only a space in the older application/x-www-form-urlencoded format used by HTML form submissions, so do not mix the two conventions.

Do I need to encode non-English characters in a URL?

Yes. Accented letters, CJK characters, and emoji are encoded as their UTF-8 bytes, which is why a single character can turn into several %XX pairs. Modern browsers display the readable form but transmit the encoded one.

Is it safe to paste a URL with a token into this tool?

Everything runs locally in your browser — the text you paste is never sent to a server, logged, or stored. That said, treat any token you handle anywhere as sensitive and rotate it if you are unsure.

Tips for Working With Percent Encoding

  • Tip 1: Encode each query value on its own. Encoding a whole query string at once escapes the & and = separators and breaks the parameters apart.
  • Tip 2: Never encode twice. A double-encoded string turns % into %25, so %20 becomes %2520 and the receiving server sees a literal percent sign.
  • Tip 3: Decode a suspicious link before you click it. Attackers hide redirect targets and script payloads behind long percent-encoded tails.
  • Tip 4: Building canonical and Open Graph URLs? Encode them here, then drop them into the meta tag generator. If the value is going into page markup instead of a link, escape it with the HTML entity encoder and decoder first.