URL Encoder & Decoder
Encode and decode URLs instantly. Supports encodeURI, encodeURIComponent, and Base64URL. 100% client-side.
Drop a file here or click to upload
URL encoding, also known as percent-encoding, is a method of encoding special characters in a URL by replacing them with a percent sign (%) followed by two hexadecimal digits. This is essential because URLs can only contain a limited set of characters from the ASCII character set.
There are two main JavaScript functions for URL encoding: encodeURI() and encodeURIComponent(). encodeURI() encodes a complete URL but preserves characters that have special meaning in URLs like :, /, ?, #, and &. encodeURIComponent() encodes everything except unreserved characters (A-Z, a-z, 0-9, -, _, ., ~), making it ideal for encoding individual query parameter values.
Common characters that get encoded include: space becomes %20, & becomes %26, = becomes %3D, + becomes %2B, and # becomes %23. Understanding when to use each encoding function is crucial for building correct URLs in web applications.
URL encoding is used in HTTP query strings, form submissions, API requests, redirect URLs, and cookie values. This tool runs entirely in your browser — no data is sent to any server.
Frequently Asked Questions
encodeURI() encodes a full URL but preserves special URL characters like :, /, ?, #, and &. encodeURIComponent() encodes everything except A-Z, a-z, 0-9, -, _, ., ~. Use encodeURIComponent for query parameter values.
URLs can only contain ASCII characters. Special characters like spaces, &, =, and non-ASCII characters must be percent-encoded to be safely transmitted in URLs.
Percent-encoding replaces unsafe characters with a % followed by two hexadecimal digits representing the character's ASCII code. For example, a space becomes %20.