URL Encoder & Decoder

Encode and decode URLs and URL components online. Supports encodeURIComponent and encodeURI.

100% Client-Side Processing — Your Data Never Leaves Your Browser
Input
Output

What is URL Encoding?

URL encoding, also known as percent-encoding, is a mechanism for encoding information in a Uniform Resource Identifier (URI). It replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits representing the character's byte value. This ensures that URLs are transmitted correctly over the internet without ambiguity.

encodeURIComponent vs encodeURI

JavaScript provides two built-in functions for URL encoding. encodeURIComponent() encodes a URI component by escaping all characters except letters, digits, and - _ . ! ~ * ' ( ). It is used for encoding query parameter values and path segments. encodeURI() encodes a complete URI but preserves characters that have special meaning in URIs such as : / ? # [ ] @ ! $ & ' ( ) * + , ; =. Use encodeURIComponent for individual values and encodeURI for complete URLs.

When to Use URL Encoding

URL encoding is essential when passing user input as query parameters, embedding special characters in URLs, building API requests with dynamic values, and encoding file paths that contain spaces or international characters. This tool processes everything locally in your browser, ensuring your URLs and data remain private.

Build with Phoenix Code

A modern code editor with live preview, built for web developers and designers.

Try Phoenix Code