Skip to content
← Blog
🔒 All in your browser 🚫 No uploads stored
Guide

URL Encoding and Decoding: Complete Guide with Examples

Bill Crawford — Guide — February 2026 — 7 min read  ·  Last updated January 29, 2026

The URL Encoder/Decoder converts characters that are not safe in URLs into their percent-encoded equivalents, and decodes them back. Whether you're building API requests, debugging query strings, or working with redirects, this tool handles both directions instantly in your browser.

Connect on LinkedIn →

Contents
  1. What is URL encoding?
  2. When to encode vs decode
  3. How to use the tool
  4. Common encoding examples
  5. encodeURI vs encodeURIComponent
  6. Tips and edge cases

Ready to encode or decode a URL? Open the tool and paste your string.

Open URL Encoder ↗

What Is URL Encoding?

URLs can only contain a limited set of ASCII characters. Spaces, special characters like &, =, #, and non-ASCII characters like accented letters or emoji must be converted before they can appear in a URL. URL encoding (also called percent-encoding) replaces each unsafe character with a % followed by its two-digit hexadecimal code.

For example, a space becomes %20, the & ampersand becomes %26, and a forward slash becomes %2F. The browser or server on the receiving end decodes these sequences back into the original characters.

When to Encode vs Decode

Encode when:

Decode when:

How to Use the Tool

1
Paste your text or URL

Type or paste the string you want to encode or decode into the input box. This can be a full URL, just a query string value, or any text string.

2
Choose Encode or Decode

Select whether you want to encode (convert special characters to percent sequences) or decode (convert percent sequences back to readable characters). The tool processes your input instantly as you type.

3
Copy the result

Click the Copy button to copy the encoded or decoded string to your clipboard, ready to paste into your code, browser, or API client.

Common Encoding Examples

Original Encoded Why
hello worldhello%20worldSpaces not allowed in URLs
name=John & age=30name%3DJohn%20%26%20age%3D30= and & are query delimiters
https://example.comhttps%3A%2F%2Fexample.comEncoding URL as a parameter value
cafécaf%C3%A9Non-ASCII character

encodeURI vs encodeURIComponent

If you use JavaScript, you've likely encountered both encodeURI() and encodeURIComponent(). They differ in what they leave alone:

Rule of thumb: Use encodeURIComponent() for query parameter values. Use encodeURI() only if you're encoding a complete URL that already has its structure intact.

// Encoding a query parameter value — use encodeURIComponent
const query = encodeURIComponent("hello world & more");
const url = `https://example.com/search?q=${query}`;
// → https://example.com/search?q=hello%20world%20%26%20more

Tips and Edge Cases

Double-encoding

If you encode a string that's already encoded, the % signs themselves get encoded into %25, resulting in %2520 instead of %20. Always decode first if you're unsure whether your input is already encoded.

Plus signs in query strings

Some systems use + to represent a space in query strings (the application/x-www-form-urlencoded format). Percent-encoding uses %20. The two are equivalent in most query string contexts but not in path segments.

Fragment identifiers

The # character starts a fragment identifier. If your URL contains a hash and you only want to encode the path or query string, be careful not to encode the # itself.

Frequently Asked Questions

What characters get percent-encoded?
Any character outside the unreserved set — A–Z, a–z, 0–9, hyphen, underscore, period, and tilde — gets encoded. This includes spaces, punctuation like & = ? # @ : / and all non-ASCII characters including emoji and accented letters.
Can I encode a full URL?
Yes, but it depends what you're trying to do. If you want to pass a URL as a query parameter value (e.g. a redirect URL), encode the whole thing. If you want the URL to remain functional, encode only the values inside query parameters, not the structural characters like :// and /.
Why does my encoded URL look different in different tools?
Different tools may encode different sets of characters. Some encode only the minimum required, others encode everything non-alphanumeric. Both are technically valid — the server decodes them all the same way.
Does encoding change the meaning of the URL?
No. A properly encoded URL is functionally identical to the decoded version — it's just a safe representation for transmission. The server decodes it before processing.

Related Tools

Further reading: MDN — encodeURIComponent() · RFC 3986 — URI Syntax

BC
Bill Crawford
Founder, Data Conversion Center

Bill Crawford is a data systems developer and technical founder with over 30 years of professional experience in accounting, finance, and business operations.

He holds a Bachelor's degree in Accounting and has spent more than three decades working within financial and operational environments. Over the past 10 years, he has been heavily involved in the development, implementation, and refinement of financial and enterprise data systems for both Fortune 500 companies and smaller organizations.

His work bridges finance and technology — combining deep domain knowledge in structured reporting and accounting workflows with hands-on SQL development and database architecture experience.

Bill founded DataConversionCenter.com to build practical, browser-based tools that simplify complex data challenges, including:

Rather than focusing on theoretical examples, his tools and articles are informed by real-world challenges encountered in enterprise reporting systems, financial databases, and operational data environments.

Professional Background

Bill's mission is to reduce friction in data workflows — particularly for professionals working with structured financial, operational, and reporting data.