DevPik Logo

URL Encoder / Decoder

Percent-encode URL components or decode encoded strings. Supports encodeURIComponent and encodeURI modes for query parameters, full URLs, and handles Unicode characters correctly.

Why Use URL Encoder / Decoder?

Copy a search URL that contains a space or an ampersand and the server on the other end may receive a truncated query — the browser quietly silently cut the parameter at the first unescaped delimiter. URL encoding is the fix, but hand-encoding with a percent table is tedious and error-prone. A good encoder does two things: lets you pick the right RFC (`encodeURIComponent` for single parameter values vs. `encodeURI` for whole URLs), and preserves the characters that are already valid so you don't double-encode. The decoder is just as useful for reading logs and network tabs where everything is percent-escaped.

How to Use URL Encoder / Decoder

  1. Enter the URL or text you want to encode in the input field.
  2. Click 'Encode' to convert special characters to percent-encoded format (%20, %3A, etc.), or paste an encoded URL and click 'Decode' to make it readable.
  3. Copy the result with the copy button.

Worked Examples

Encode a search query for a redirect URL

Input
Encode: "tom & jerry 2026 trailer"
Output
tom%20%26%20jerry%202026%20trailer

Notice `&` → `%26` — without encoding, the `&` would start a new query parameter.

Decode a log URL to read it

Input
Decode: https://api.example.com/search?q=hello%20world%20%E2%98%95
Output
https://api.example.com/search?q=hello world ☕

The three-byte `%E2%98%95` sequence decodes to a single UTF-8 ☕ coffee emoji.

Double-encode a value that travels through two layers

Input
Encode "value with /slash" twice
Output
value%2520with%2520%252Fslash

Each `%25` is an encoded `%` — required when a value passes through a proxy that decodes once before forwarding.

About URL Encoder / Decoder

URL encoding (also called percent-encoding) is the process of replacing special characters in a URL with a '%' followed by their hexadecimal value, ensuring URLs are transmitted correctly across the internet. The URL Encoder/Decoder converts text to and from percent-encoded format. URL encoding replaces unsafe characters with a '%' followed by their hexadecimal value, ensuring that URLs are transmitted correctly across the internet. This is essential when building query strings, passing parameters to APIs, encoding form data, or debugging URLs with special characters. Reserved characters like spaces, ampersands (&), question marks (?), equals signs (=), and hash symbols (#) have special meaning in URLs and must be encoded when used as data values. Our tool supports both `encodeURIComponent` (for query parameters) and full URL encoding, handling all international characters and emoji properly.

Troubleshooting & Common Issues

Decoded URL shows `+` instead of spaces

`application/x-www-form-urlencoded` uses `+` for space (mostly in HTML form submissions), while percent-encoding uses `%20`. Both are valid; most decoders handle one but not the other. Replace `+` with `%20` before decoding if your source is a form body, or use a form-aware decoder.

Special characters like `é` or `😀` become `?` or garbage

Percent-encoding operates on bytes, and non-ASCII characters produce multi-byte sequences in UTF-8. If your source was encoded with ISO-8859-1 (a legacy default in older systems), the decoder's UTF-8 pass produces mojibake. Re-encode the source as UTF-8 before decoding.

I encoded a full URL and now the `://` is broken

You used `encodeURIComponent` on the whole URL — it escapes `/` and `:` too. For a complete URL use `encodeURI`, which preserves reserved characters. For individual query-parameter values, keep using `encodeURIComponent`.

The server rejects my encoded value as malformed

Some servers strictly follow RFC 3986 and reject characters that older browsers leave unescaped (like `~` or `!`). Enable "strict mode" if your encoder supports it, or manually encode those characters using percent-hex values.

Frequently Asked Questions

When do I need to URL encode?

You need URL encoding whenever you're passing data through URLs that contains special characters — spaces become %20, ampersands become %26, etc. This is critical for query strings, form submissions, and API requests.

What's the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL but preserves characters that have special meaning (like / and ?). encodeURIComponent encodes everything including those special characters, making it suitable for encoding individual query parameter values.

Why do spaces appear as %20 or +?

In URL encoding, spaces can be represented as %20 (standard percent-encoding) or as + (application/x-www-form-urlencoded format used in HTML forms). Both are valid; %20 is more universal and recommended for path segments.

Related Tools

Was this tool helpful?