What is URL Encoder / Decoder?

Free URL encoder and decoder. Encode special characters for safe use in URLs, query strings, or HTML. Decode percent-encoded URLs instantly. Supports encodeURIComponent, encodeURI, and Base64. No signup.

No file uploadsNo tracking of inputsNo account requiredWorks offline after first load

URL Encoder runs entirely in your browser using JavaScript (browser). Your data never leaves your device.

Free URL Encoder / Decoder

Encode and decode URLs in three modes: encodeURIComponent (encodes everything except unreserved characters — best for query string values), encodeURI (preserves the full URL structure), and Base64 (for embedding binary or non-ASCII data). Instantly see encoded and decoded output side-by-side with copy buttons. Handles Unicode, special characters, and long strings. 100% browser-based.

Free to embed on your website · No signup required

encodeURIComponent encodes all characters except: A–Z a–z 0–9 - _ . ! ~ * ' ( ) — use this for individual query parameter values.

Frequently Asked Questions

URL encoding (percent-encoding) replaces unsafe ASCII characters with a % followed by two hexadecimal digits. For example, a space becomes %20 and & becomes %26. This ensures special characters are transmitted correctly in URLs and query strings.
Use encodeURIComponent when encoding a single query parameter value — it encodes characters like /, ?, &, = which have special meaning in URLs. Use encodeURI when encoding an entire URL — it preserves the structure characters (/, :, ?, &, #) and only encodes characters that are truly unsafe in a URL.
encodeURIComponent encodes everything except: A–Z, a–z, 0–9, -, _, ., !, ~, *, ', (, ). encodeURI additionally preserves: ; , / ? : @ & = + $ # (the URL structural characters).
%20 is the percent-encoded representation of a space character. The percent sign followed by a two-digit hexadecimal code represents a single byte of data. Spaces and other special characters must be encoded before being included in a URL.
Yes. All encoding and decoding happens entirely in your browser. Your data is never sent to any server, making it safe to use with sensitive values.

URL Encoding in Web Development

URL encoding (officially called percent-encoding) is required whenever a URL must carry characters that are either reserved (having special meaning in URL syntax) or that are not safe to transmit in the ASCII range. The HTTP specification mandates that URLs contain only a subset of ASCII characters — spaces, Unicode characters, and symbols like <, >, #, and % must be encoded before being sent in a request.

encodeURIComponent vs encodeURI

JavaScript provides two built-in encoding functions with an important distinction. encodeURIComponent encodes every character except unreserved characters (letters, digits, - _ . ! ~ * ' ( )). This makes it ideal for encoding a single query string value where characters like &, =, +, and / would otherwise break the URL structure. encodeURI leaves URL-structural characters intact (/ : ? & = + $ # ; , @) and is intended for encoding a complete URL when you want to preserve its structure while only escaping unsafe characters.

When to Use Each Mode

Use encodeURIComponent when building query strings: ?q=hello+world&lang=en should be constructed as ?q=encodeURIComponent("hello world")&lang=encodeURIComponent("en"). Use encodeURI when you have a complete URL with a path and query string that already uses correct URL syntax and you just need to escape unsafe Unicode characters. Use Base64 when you need to embed binary data or non-ASCII text in a URL-safe way, such as in a data URI or a JWT.