🔗 URL Encode / Decode

Percent-encode text for safe use in a URL, or decode a percent-encoded URL back to plain text, instantly.

✍️ Input
Converted live as you type, entirely in your browser. Nothing is sent to a server.
📤 Output
🔗

Type or paste text to see the converted output

Guide

About the URL Encode / Decode Tool

Last updated: August 2026 · Reviewed by the NeftCal editorial team

This free URL encoder and decoder percent-encodes text so it's safe to use inside a URL, or decodes a percent-encoded URL back into readable text — instantly, live, and entirely inside your browser. URL encoding is essential whenever a value like a search query, filename, or parameter contains spaces, symbols, or non-ASCII characters that could otherwise break the URL.

How It Works

Choose Encode to percent-encode your text, or Decode to convert a percent-encoded string back into plain text. Internally, the tool uses JavaScript's encodeURIComponent and decodeURIComponent functions, which convert every character outside the small "unreserved" set (letters, digits, and - _ . ~) into a % followed by its two-digit hexadecimal UTF-8 byte value — for example, a space becomes %20 and an ampersand becomes %26.

Who Should Use This Tool

Developers building query strings or debugging why a link with special characters breaks, anyone decoding a long, unreadable percent-encoded URL back into plain text, and students learning how browsers safely transmit non-ASCII characters in URLs. It's a quick, no-signup alternative to running encodeURIComponent() in a browser console.

Real-World Applications

  • Safely building query string parameters that contain spaces, symbols, or special characters
  • Decoding a long, unreadable percent-encoded URL from a shared link or log file
  • Debugging API requests where a parameter contains reserved characters like & or #
  • Encoding search terms, filenames, or user input before appending them to a URL
  • Understanding how international domain names or search queries appear in encoded URLs

Tips for Accurate Results

  • This tool encodes an entire input the same way encodeURIComponent does — meant for individual values, not a full URL with its own structure.
  • If you need to encode a full URL while preserving its structure (like :// and /), use encodeURI logic instead, which leaves structural characters untouched.
  • Decoding an already-decoded string is safe and simply returns the same text, since there's nothing left to unescape.
  • This tool handles UTF-8 text correctly, so emoji and non-Latin characters round-trip without corruption.
Formula

How URL Percent-Encoding Works

The character-by-character process behind the conversion

Step 1 — Check Each Character
Letters, digits, and - _ . ~ (the "unreserved" set) are left unchanged

Step 2 — Encode Everything Else
All other characters are converted to their UTF-8 byte representation

Step 3 — Format as Percent-Codes
Each byte is written as %XX, where XX is its two-digit hexadecimal value

Example
A space (0x20) becomes %20, an ampersand (0x26) becomes %26
🔓

Unreserved Characters

Letters (A-Z, a-z), digits (0-9), and - _ . ~ are always safe in a URL and never need encoding.

⚠️

Reserved Characters

Characters like & ? # / : have structural meaning in URLs — as literal data within a value, they must be encoded to avoid confusion.

🌍

Non-ASCII Characters

Any character outside basic ASCII (accented letters, emoji, non-Latin scripts) is encoded via its UTF-8 byte sequence.

⚙️ Why This Format Works

URLs were originally designed to be transmitted over systems that only reliably handled a small set of ASCII characters. Percent-encoding lets any character — including spaces, symbols, and full Unicode text — be represented using only that safe ASCII subset, so URLs work consistently across every browser, server, and protocol.

🎯 When to Use It

  • Building a query string parameter that contains spaces or symbols
  • Decoding a long percent-encoded URL back into readable text
  • Debugging API calls where special characters break a request

📋 Assumptions

  • Input text is treated as UTF-8 encoded when encoding
  • Encoding behavior matches JavaScript's encodeURIComponent, suited to individual values rather than full URLs

⚠️ Limitations

  • Encodes structural URL characters (/, :, ?, &) too — not ideal for encoding a complete URL at once
  • Decoding a malformed percent-encoded string may throw an error rather than a partial result
Walkthrough

Step-by-Step: How to Use This Tool

From choosing a mode to copying your result

Choose a mode

Select Encode to percent-encode text for use in a URL, or Decode to convert a percent-encoded URL back to plain text.

Enter your text

Type or paste the text or URL into the input box.

Read the result

The converted output appears instantly below, ready to copy.

Example

Worked Example

Encoding a search query with a space and an ampersand

Encoding "hello world&lang=en"

Input Texthello world&lang=en
Step 1: The space between "hello" and "world" is converted to %20, since spaces aren't allowed unencoded in a URL.
Step 2: The & character is converted to %26, since it's reserved as a query-string separator and must be encoded when it's part of the actual value.
Encoded Output
hello%20world%26lang%3Den
Use Cases

Practical Use Cases for URL Encoding

Where percent-encoding shows up day to day

🔍

Search query parameters

Encoding a multi-word search term before appending it to a URL's query string.

🧩

API request debugging

Understanding why a parameter containing & or # broke an API call.

📎

Shared links

Decoding a long, unreadable percent-encoded URL pasted from a browser or log file.

🌐

International text in URLs

Seeing how accented characters or non-Latin scripts are represented in a URL.

📁

Filenames with special characters

Encoding filenames or paths that contain spaces or symbols before linking to them.

Pros & Cons

Advantages and Limitations

What this tool does well, and where percent-encoding has boundaries

✅ Advantages

  • Free, instant, and requires no signup
  • Runs entirely in your browser — nothing is sent to a server
  • Correctly handles UTF-8 text, including emoji and non-Latin scripts
  • Clear error messages for invalid percent-encoded input
  • One-click copy for the converted result

⚠️ Limitations

  • Encodes an entire input as one value (encodeURIComponent behavior) rather than preserving full-URL structure
  • Does not distinguish between query-string + notation and %20 for spaces
Reference

Common Mistakes and Expert Tips

Get accurate results every time

❌ Common Mistakes

  • Encoding a full URL (including https:// and /) with component-style encoding, breaking its structure
  • Forgetting that + means space only inside query strings, not in encodeURIComponent output
  • Double-encoding a string that's already percent-encoded, producing %2520 instead of %20
  • Assuming decoding always succeeds — malformed percent sequences can throw an error

💡 Expert Tips & Best Practices

  • Encode individual query parameter values, not the whole URL, to preserve its structure
  • Check whether a string is already encoded before encoding it again
  • Use this tool to quickly read what a long percent-encoded tracking or redirect URL actually says
  • Remember reserved characters like & and = are only unsafe when they appear as literal data, not as URL structure
📝

Summary: This tool percent-encodes text for safe use in a URL or decodes a percent-encoded URL back to plain text, instantly and entirely client-side. Pair it with the Base64 Encode / Decode tool for other text-encoding needs.

FAQ

Frequently Asked Questions

Common questions about URL encoding

What is URL encoding?
URL encoding (also called percent-encoding) converts characters that aren't safe in a URL — spaces, &, ?, #, non-ASCII characters, and more — into a % followed by two hexadecimal digits representing that character's byte value, so the URL can be transmitted correctly by any browser or server.
Why do spaces become %20 or + in URLs?
%20 is the percent-encoded form of a space character in a URL path or component. The + symbol is a separate, older convention used specifically inside URL query strings (application/x-www-form-urlencoded) to represent a space. This tool uses %20, the encodeURIComponent standard, which is safe in both contexts.
What's the difference between encodeURI and encodeURIComponent?
encodeURI is meant for encoding a full URL and leaves characters like /, :, ?, and & untouched since they're structurally meaningful in a URL. encodeURIComponent is meant for encoding a single value — like a query parameter — and encodes those same characters too, since within a component they should be treated as literal data, not structure. This tool uses encodeURIComponent behavior, correct for encoding individual values such as query parameters.
Which characters need to be percent-encoded in a URL?
Reserved characters (like & ? # / : @) and unsafe characters (spaces, quotes, angle brackets, and any non-ASCII character) need encoding when they appear as literal data rather than URL structure. Unreserved characters — letters, digits, and - _ . ~ — never need encoding.
Does this tool support emoji and non-English text?
Yes. The tool encodes text as UTF-8 bytes before percent-encoding, so emoji, accented characters, and non-Latin scripts (like Chinese, Arabic, or Cyrillic) round-trip correctly through encode and decode, matching how modern browsers handle international URLs.
Is my text sent to a server when I use this tool?
No. All encoding and decoding happens locally in your browser using JavaScript's built-in encodeURIComponent and decodeURIComponent functions. Nothing you type is transmitted, logged, or stored anywhere.
Learn More

Authoritative Resources on URL Encoding

Technical references to complement this tool

Related Calculators

Other internet and developer tools