URL Encoder & Decoder

Encode or decode URLs with percent-encoding instantly. Runs in your browser — nothing is sent to any server.

encodeURIComponent encodes all special characters including : / ? # & = (best for encoding query parameter values)

URL Parser

Paste a full URL to break it down into its individual components.

Need more developer tools?

Check out the full OGPix toolkit — OG image generator, favicon maker, JWT decoder, Base64 converter, and more. All free.

Browse All Tools →

What Is URL Encoding (Percent-Encoding)?

URL encoding, also known as percent-encoding, is a mechanism for encoding characters in a Uniform Resource Identifier (URI) that may otherwise have special meaning or are not allowed in URLs. Each unsafe character is replaced with a % sign followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20, and an ampersand becomes %26.

encodeURIComponent vs encodeURI

JavaScript provides two built-in functions for URL encoding. encodeURIComponent() encodes all special characters including : / ? # [ ] @ ! $ ' ( ) * + , ; =. It is best for encoding individual query parameter keys and values. encodeURI() preserves characters that have special meaning in a URL structure (like :, /, ?, #, &, =) and only encodes characters that are completely invalid in a URI. Use encodeURI when encoding a complete URL and encodeURIComponent when encoding a value to be placed inside a URL.

How This Tool Works

Type in either textarea and the other updates in real time. The decoded (plain text) side uses encodeURIComponent() or encodeURI() to produce the encoded output. The encoded side uses the corresponding decode function to reverse it. All processing happens entirely in your browser — no data is sent to any server.

When to Use URL Encoding

URL encoding is essential whenever you need to include special characters in URL query parameters, form data submitted via GET requests, API request parameters, redirect URLs passed as parameters, or any user-generated content that appears in a URL. Without proper encoding, characters like &, =, and ? would be misinterpreted as URL delimiters.

Frequently Asked Questions

Is my data safe?

Yes. All encoding and decoding happens entirely in your browser using JavaScript's built-in encodeURIComponent and decodeURIComponent functions. No data is ever sent to a server.

What is the difference between %20 and +?

Both represent a space character. %20 is the standard percent-encoding for a space used in URL paths and most contexts. + is used specifically in application/x-www-form-urlencoded form data (like HTML form submissions). This tool uses %20 as per the standard JavaScript encoding functions.

Which mode should I use?

Use encodeURIComponent (the default) in most cases, especially when encoding query parameter values, form fields, or any text that will be placed inside a URL. Use encodeURI only when you want to encode a complete URL while preserving its structure characters.

Does it handle Unicode characters?

Yes. JavaScript's built-in encoding functions handle Unicode characters by first encoding them as UTF-8 bytes, then percent-encoding each byte. For example, the euro sign € becomes %E2%82%AC.

What does the URL Parser do?

The URL Parser breaks down a full URL into its components: protocol, host, path, individual query parameters (with their decoded values), and fragment. This is useful for debugging URLs, inspecting query strings, or understanding how a URL is structured.