Skip to content
nearnull

URL Encoder / Decoder

Percent-encode or decode text for safe use in URLs and query strings. Runs entirely in your browser. Nothing is sent to any server.

Encodes every character not safe in a single query-string value. Use this for a value you're inserting into a URL (query param, path segment).

Result
Result will appear here

What is URL encoding?

URL (percent) encoding replaces characters that aren't safe inside a URL (spaces, `&`, `=`, `#`, non-ASCII letters, and more) with a `%` followed by their hex byte value, so the string can travel inside a URL without being misread as part of its structure. This tool offers two modes: component mode (`encodeURIComponent`), which escapes everything unsafe in a single value like a query parameter, and full-URI mode (`encodeURI`), which leaves structural characters like `:`, `/`, `?`, `#` and `&` alone because they're expected to appear in a complete URL.

Examples

Percent-encode or decode a string natively in most languages:

JavaScript
encodeURIComponent(str)
decodeURIComponent(str)
Python
from urllib.parse import quote, unquote
quote(s)
unquote(s)
Java
URLEncoder.encode(s, "UTF-8")
URLDecoder.decode(s, "UTF-8")
C#
Uri.EscapeDataString(s)
Uri.UnescapeDataString(s)
Go
import "net/url"

url.QueryEscape(s)
url.QueryUnescape(s)
PHP
rawurlencode($s)
rawurldecode($s)
Ruby
require 'erb'
ERB::Util.url_encode(s)
CGI.unescape(s)

Use Cases

Building query string parameters

Encode a value (search term, email, free text) before appending it to a URL as `?q=<value>`, so characters like `&` or `#` in the value don't break the query string.

Debugging a malformed link

Decode a URL you received to see its real, human-readable form. Useful when a redirect or webhook payload has garbled percent-encoded characters.

Working with API request URLs

Many APIs require path segments or parameters to be percent-encoded. Encode IDs or filter values here before hand-building a request URL.

Reading tracking and redirect URLs

Marketing links and OAuth redirects often nest a full URL inside a query parameter. Decode it to see the actual destination before clicking.

Frequently Asked Questions

What's the difference between the two modes?
Component mode (encodeURIComponent) escapes every character that isn't safe in a single value. Use it for a query parameter or path segment. Full-URI mode (encodeURI) is for encoding an entire URL at once, so it leaves the structural characters (: / ? # & =) alone since they're expected to separate the URL's parts.
Why does decoding sometimes fail?
A `%` in the input isn't followed by two valid hex digits, so it isn't a well-formed percent-encoded sequence. This usually means the text wasn't actually URL-encoded, or was encoded twice and needs to be decoded twice as well.
Should I encode a full URL or just part of it?
Only encode the parts that come from user input or free text, like a query parameter value. Encoding an entire URL in component mode would also escape its `:`, `/` and `?`, breaking it; use full-URI mode if you really need to encode a whole URL.
Is my data sent to a server?
No. Encoding and decoding happen entirely in your browser with plain JavaScript. Nothing you type here is transmitted or stored anywhere.
Does this handle non-ASCII characters like emoji or accents?
Yes. Both modes encode any character outside the small set of URL-safe ASCII characters, including accented letters, emoji, and other Unicode text, by escaping their UTF-8 bytes.