URL Encoder & Decoder
Used 5,700 times
Encode plain text or URLs using encodeURIComponent, or decode percent-encoded strings back to readable text. Runs entirely in your browser — nothing is sent to a server.
Encodes special characters (spaces, &, =, #, etc.) so they're safe to use in a URL. Uses encodeURIComponent().
Latest Encoding articles
Base64 Decode Corrupted Strings – Recover Payloads from Logs
Learn how to recover Base64-encoded payloads from audit logs when copy-paste strips padding. A Base64 decoder that flags padding and alphabet issues reconstructs the original data.
Base64 Encode and Decode – What It Is and How to Use It
What Base64 is, why it exists, how it differs from encryption, and where you encounter it daily — Kubernetes secrets, HTTP Basic Auth, JWTs, and data URIs.
Base64 Encode Images as Data URIs – Embed Assets Without Hosting
Learn how to Base64-encode images and files as data URIs for HTML embedding. Inline small icons and SVGs without a separate hosting dependency. Free browser-based Base64 encoder.
What is URL Encoding?
URL encoding (percent-encoding) replaces characters that are unsafe in a URL with a % followed by two hex digits. For example, a space becomes %20 and & becomes %26. This tool uses encodeURIComponent, which encodes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ).
How to Use
- Paste the string you want to encode or decode into the input box.
- Click Encode to percent-encode it, or Decode to reverse percent-encoding.
- The result appears instantly. Click Copy Output to copy it.
Common Use Cases
- Query parameters — Encode values before appending to a URL:
?q=hello+worldshould be?q=hello%20world. - Decoding API responses — URLs returned by APIs or in redirect headers often contain percent-encoded characters.
- curl & HTTP clients — Special characters in request bodies or headers must be encoded to avoid parse errors.
- OAuth & webhook URLs — Callback URLs passed as query parameters must be fully encoded.
FAQs
What is the difference between encodeURI and encodeURIComponent?
encodeURI preserves characters that are valid in a full URL (: / ? # & =). encodeURIComponent encodes all of them — use it for individual query values, not full URLs.
Why is a space sometimes + and sometimes %20?
+ is the application/x-www-form-urlencoded encoding for a space (used in HTML forms). %20 is the RFC 3986 percent-encoding. Use %20 in URLs; + only in form bodies.
Can I encode an entire URL at once?
Encoding a complete URL with encodeURIComponent will also encode the :// and / path separators, breaking the URL. Only encode the individual values you are embedding as query parameters.