Encode or decode URLs with percent-encoding. Supports encodeURIComponent and encodeURI. Free, private, browser-based. Free online tool, no sign-up.
URL encoding, also called percent-encoding, is a mechanism for encoding characters that have special meaning in URLs or are not allowed in the URL specification (RFC 3986). Each unsafe character is replaced with a percent sign (%) followed by its two-digit hexadecimal representation.
For example, a space becomes %20, an ampersand becomes %26, and a Japanese character like "東" becomes %E6%9D%B1 (its UTF-8 bytes in hex).
URLs have a strict syntax where certain characters have special meanings: ? starts the query string, & separates parameters, # marks a fragment, and / separates path segments. If user data contains these characters and isn't encoded, the URL breaks.
JavaScript provides two encoding functions with different scopes:
A-Z a-z 0-9 - _ . ~. Use for individual query parameter values.: / ? # [ ] @ ! $ & ' ( ) * + , ; =). Use for encoding a complete URL.This tool provides both: the main encode button uses encodeURIComponent (safest for parameter values), and the "Encode Full URL" button uses encodeURI.
Space: %20, Ampersand: %26, Equals: %3D, Plus: %2B, Slash: %2F, Question mark: %3F, Hash: %23, At sign: %40.
A common mistake is encoding a string that's already encoded, producing double-encoded values like %2520 (the % in %20 gets encoded to %25). Use the decode function to check if a string is already encoded before encoding it again.
All encoding and decoding happens in your browser using JavaScript's native functions. No data is sent to any server. You can safely encode URLs containing tokens, credentials, and private parameters.
Encode data for transport with our Base64 Encoder. Escape HTML characters with our HTML Entity Encoder.
URL encoding (percent-encoding) replaces unsafe characters with a '%' followed by two hex digits. For example, a space becomes %20, and '&' becomes %26. This ensures special characters don't break URL structure.
encodeURI encodes a full URL, preserving characters like :, /, ?, #, and &. encodeURIComponent encodes everything except letters, digits, and - _ . ~ — use it for query parameter values.
Always encode user-provided values before inserting them into URLs. This prevents URL injection, broken links, and ensures special characters like spaces and ampersands are transmitted correctly.
Yes. All encoding and decoding runs locally in your browser using JavaScript's built-in functions. No data is transmitted to any server.
Browse all free tools · Guides and tutorials · PDF tools · Developer tools · Text tools · SEO tools