hello world hello%20world

URL Encoder/Decoder

Encode and decode URLs instantly. Convert special characters to URL-safe format or decode encoded URLs back to readable text. Perfect for web developers, SEO professionals, and anyone working with URLs.

What is URL Encoding?

URL encoding (percent encoding) converts special characters to URL-safe format. Spaces become %20, ampersands become %26. Essential for URLs with special characters, query parameters, or non-English text. Our tool handles encoding and decoding instantly with real-time results.

Mode

Choose whether to encode (make URL-safe) or decode (make readable)

Input

Enter URLs with spaces, special characters, or non-English text. Results appear instantly.

Common Encodings

Space %20
& (ampersand) %26
= (equals) %3D
? (question) %3F
# (hash) %23
+ (plus) %2B

Encoded Result

Analysis

Enter text to see analysis

Statistics

Characters Changed
0
Size Change
0%
Lines Processed
0
Encoding
UTF-8

Usage Tips

Batch Processing

Paste multiple URLs (one per line) to encode or decode them all at once.

Avoid Double Encoding

Always decode first before re-encoding. Double encoding breaks URLs.

International Characters

UTF-8 encoding works for all languages, emojis, and special characters.

Make URLs Safe for the Web

Imagine sending someone a link to search for "coffee & tea" on your website, but when they click it, the search breaks or returns wrong results because the ampersand (&) has special meaning in URLs. Or you receive an analytics report with URLs full of %20 and %3F making them completely unreadable—you have no idea what pages people actually visited. These problems happen because URLs have strict rules about which characters they can contain, and special characters must be encoded (converted to %XX format) for URLs to work correctly.

Our URL Encoder/Decoder solves both problems instantly. Need to create a URL with spaces, symbols, or non-English characters? The encoder converts them to URL-safe format (%20 for space, %26 for &). Trying to read an encoded URL full of percent signs and codes? The decoder translates it back to normal, human-readable text. Process single URLs or batch-encode hundreds at once. See results in real-time as you type. Copy the encoded or decoded URLs with one click. Whether you're a developer building URLs programmatically, an SEO analyzing traffic, or someone who just needs to fix a broken link, this tool handles all URL encoding and decoding needs instantly and accurately.

How to Encode or Decode URLs

01

Choose Encode or Decode

Select "Encode" to convert a readable URL to safe format with special characters encoded. Select "Decode" to convert an encoded URL (with %20, %3F, etc.) back to readable text. Switch between modes instantly.

02

Paste Your URL or Text

Enter the URL you want to encode or decode. Paste full URLs, query strings, or just the parts with special characters. For batch processing, paste multiple URLs (one per line). The tool handles any length or format.

03

See Instant Results

Results appear in real-time as you type or paste. For encoding, see which characters get converted to %XX format. For decoding, see the readable text instantly. The tool highlights what changed so you understand the conversion.

04

Copy and Use

Click "Copy" to copy the encoded or decoded result to clipboard. Use the encoded URL in your web application, API call, or link. Use decoded URLs to understand analytics data or debug issues. Process as many URLs as you need.

Powerful URL Encoding Features

URL Encoding

Convert URLs with spaces, symbols, and special characters to URL-safe format. Automatically encodes all characters that could break URLs or cause issues.

URL Decoding

Translate encoded URLs with %20, %3F, and other codes back to human-readable format. Makes sense of messy-looking URLs instantly.

Batch Processing

Process multiple URLs simultaneously. Paste a list of URLs and encode or decode them all at once. Perfect for bulk operations on log files or data exports.

UTF-8 Support

Correctly encodes international characters from any language—Chinese, Arabic, emoji, accents. Handles UTF-8 encoding to percent-encoded format automatically.

Real-Time Conversion

See results instantly as you type. No need to click buttons—encoding and decoding happens automatically. Immediate feedback helps you learn what gets encoded.

One-Click Copy

Copy results to clipboard with single click. No manual selection needed. Fast and convenient for using results immediately in your work.

Understanding URL Encoding (Percent Encoding)

URL encoding, also called percent encoding, is the process of converting characters into a format that can be safely transmitted in URLs. URLs can only contain a limited set of characters, so other characters must be encoded.

How URL Encoding Works

Characters are encoded as a percent sign (%) followed by two hexadecimal digits representing the character's ASCII or UTF-8 code. For example:

  • Space: Encoded as %20 (or + in query strings)
  • Ampersand (&): Encoded as %26
  • Equals (=): Encoded as %3D
  • Question mark (?): Encoded as %3F
  • Hash (#): Encoded as %23

Safe vs Unsafe Characters

Character Type Characters Encoding Needed?
Letters A-Z, a-z No (safe)
Numbers 0-9 No (safe)
Unreserved Symbols - _ . ~ No (safe)
Reserved Characters : / ? # [ ] @ ! $ & ' ( ) * + , ; = Yes (must encode)
Spaces (space character) Yes (becomes %20 or +)
Special/International %, <, >, {, }, |, \, ^, `, ", accents, non-Latin Yes (must encode)
Advertisement
Ad

Common Use Cases for URL Encoding

Web Development

  • Building URLs with query parameters programmatically
  • Passing URLs as parameters to other URLs
  • Creating safe redirect URLs
  • Handling user input in URLs
  • API endpoint construction with parameters

Analytics & SEO

  • Reading Google Analytics URL reports
  • Understanding encoded UTM parameters
  • Decoding search query parameters
  • Analyzing log files with encoded URLs
  • Processing referrer data with special characters

Link Sharing

  • Creating shareable links with search queries
  • Encoding URLs for email marketing
  • Building social media share links
  • Creating QR codes with URL parameters
  • Generating affiliate links with tracking

Debugging

  • Understanding why URLs break
  • Identifying double-encoding issues
  • Debugging API request failures
  • Fixing broken redirect chains
  • Troubleshooting form submissions

Common URL Encoding Examples

Here are real-world examples showing what characters look like before and after encoding:

Basic Special Characters

Original Encoded Use Case
hello world hello%20world Spaces in search queries
coffee & tea coffee%20%26%20tea Ampersands in text
price=$50 price%3D%2450 Dollar signs and equals
100% cotton 100%25%20cotton Percent signs (% becomes %25)
red+blue red%2Bblue Plus signs

URLs as Parameters

Original: Passing a URL as a parameter

https://example.com/redirect?url=https://target.com/page?id=123

Encoded: The inner URL gets encoded

https://example.com/redirect?url=https%3A%2F%2Ftarget.com%2Fpage%3Fid%3D123

Search Queries

Original: Search for "how to encode URLs?"

https://example.com/search?q=how to encode URLs?

Encoded: Spaces and question mark encoded

https://example.com/search?q=how%20to%20encode%20URLs%3F

International Characters

Original Encoded Language
café caf%C3%A9 French (é)
niño ni%C3%B1o Spanish (ñ)
你好 %E4%BD%A0%E5%A5%BD Chinese
Москва %D0%9C%D0%BE%D1%81%D0%BA%D0%B2%D0%B0 Russian
😀 %F0%9F%98%80 Emoji

When to Encode vs When to Decode

When to Encode URLs

  • Building URLs Programmatically: When constructing URLs in code with user input or dynamic data
  • Passing URLs as Parameters: When one URL contains another URL as a query parameter
  • Form Submissions: When form data with special characters is submitted via GET request
  • API Requests: When sending data to APIs that require URL-encoded parameters
  • Email Links: When creating links to include in emails (email clients may break unencoded URLs)
  • QR Codes: When generating QR codes containing URLs with parameters
  • Tracking Links: When adding UTM parameters or tracking codes to URLs

When to Decode URLs

  • Reading Analytics: When viewing Google Analytics or other analytics tools showing encoded URLs
  • Log File Analysis: When processing server logs with percent-encoded URLs
  • Debugging: When you need to understand what an encoded URL actually represents
  • Data Export Processing: When working with exported data containing encoded URLs
  • User Display: When showing URLs to users in a readable format
  • Database Queries: When searching databases for URLs in their readable form
  • Understanding Errors: When error messages contain encoded URLs you need to interpret

URL Encoding Best Practices

Encode Only What Needs Encoding

Don't encode entire URLs—preserve the structure (protocol, domain, path separators). Only encode the values that contain special characters. For example, encode query parameter values, not the entire URL including https:// and domain.

Avoid Double Encoding

Never encode an already-encoded URL. Double encoding breaks URLs by encoding the % signs themselves (%20 becomes %2520). Always check if a URL is already encoded before encoding it again. When in doubt, decode first, then re-encode if needed.

Use Proper Encoding for Context

Different parts of URLs have different encoding rules. The path, query string, and fragment each have slightly different safe characters. Use proper encoding functions for each context rather than blanket encoding everything.

Handle UTF-8 Correctly

Always use UTF-8 encoding for international characters. Don't use other encodings like ISO-8859-1 or Windows-1252. UTF-8 is the web standard and ensures characters from all languages work correctly in URLs.

Test Encoded URLs

After encoding, test the URL to verify it works correctly. Click it, pass it to the API, or submit the form to ensure encoding didn't break functionality. Some systems are sensitive to encoding differences.

Document Encoding Expectations

When building APIs or systems, clearly document whether parameters should be URL-encoded or not. This prevents confusion when integrating systems and helps developers use your API correctly.

Common URL Encoding Mistakes

Mistake 1: Encoding the Entire URL

Wrong: Encoding the complete URL including protocol and domain

https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world

Correct: Only encode the parameter values

https://example.com/search?q=hello%20world

Why: Encoding the protocol and domain breaks the URL structure. Web browsers and servers can't interpret fully-encoded URLs.

Mistake 2: Double Encoding

Problem: Encoding an already-encoded URL

Original: hello world
First encoding: hello%20world
Double encoded: hello%2520world (% becomes %25)

Result: The space never gets decoded properly. Server sees "%20" as literal text instead of space.

Mistake 3: Using + for Space in Paths

Wrong: Using + to encode spaces in URL paths

https://example.com/hello+world/page

Correct: Use %20 in paths (+ only works in query strings)

https://example.com/hello%20world/page

Mistake 4: Forgetting to Encode Ampersands

Problem: Using & in parameter values without encoding

https://example.com/search?q=coffee & tea

Why It Breaks: The & is interpreted as separating parameters, so "tea" becomes a new parameter instead of part of the search query.

Correct: Encode the ampersand

https://example.com/search?q=coffee%20%26%20tea

Mistake 5: Mixing Encoding Types

Problem: Confusing URL encoding with HTML encoding

  • URL Encoding: Space = %20, & = %26
  • HTML Encoding: Space =  , & = &

Don't use HTML entities in URLs. They don't work and will appear as literal text like "&" instead of "&".

URL Encoding in Different Programming Languages

JavaScript

// Encode entire URL component
encodeURIComponent("hello world & more");
// Returns: "hello%20world%20%26%20more"

// Encode URL (preserves / : ?)
encodeURI("https://example.com/hello world");
// Returns: "https://example.com/hello%20world"

// Decode
decodeURIComponent("hello%20world%20%26%20more");
// Returns: "hello world & more"

PHP

// Encode for URLs
urlencode("hello world & more");
// Returns: "hello+world+%26+more" (+ for space)

// Encode preserving / (RFC 3986)
rawurlencode("hello world & more");
// Returns: "hello%20world%20%26%20more"

// Decode
urldecode("hello+world+%26+more");
// Returns: "hello world & more"

Python

from urllib.parse import quote, unquote

# Encode
quote("hello world & more")
# Returns: 'hello%20world%20%26%20more'

# Decode
unquote("hello%20world%20%26%20more")
# Returns: 'hello world & more'

Java

import java.net.URLEncoder;
import java.net.URLDecoder;

// Encode
URLEncoder.encode("hello world & more", "UTF-8");
// Returns: "hello+world+%26+more"

// Decode
URLDecoder.decode("hello+world+%26+more", "UTF-8");
// Returns: "hello world & more"

Troubleshooting URL Encoding Issues

Issue: URL Not Working After Encoding

Symptoms: Encoded URL returns 404, broken link, or doesn't load

Common Causes:

  • Encoded the entire URL including protocol and domain
  • Double encoding occurred
  • Used wrong encoding for the context
  • Server doesn't properly decode URLs

Solutions: Decode and re-encode properly, verify server configuration accepts encoded URLs, test step-by-step.

Issue: Special Characters Breaking Queries

Problem: Search queries or form submissions with & or = break

Solution: These characters have special meaning in URLs (parameter separators). Always encode them in parameter values: & becomes %26, = becomes %3D.

Issue: International Characters Display Wrong

Problem: Non-English characters show as �� or garbage

Solution: Use UTF-8 encoding consistently. Ensure your pages declare UTF-8 charset, and URL encoding uses UTF-8. Mixing encodings causes character corruption.

Advertisement
Ad

Frequently Asked Questions

What is URL encoding and why is it needed?

URL encoding (also called percent encoding) converts special characters in URLs to a format that can be safely transmitted over the internet. URLs can only contain certain characters (letters, numbers, and a few symbols). When you need to include spaces, punctuation, or non-English characters in a URL, they must be encoded. For example, a space becomes %20, an ampersand becomes %26. Without encoding, these characters could break URLs or be misinterpreted by web servers.

When should I encode a URL?

Encode URLs when: passing URLs as query parameters, including spaces or special characters in URLs, sending URLs via email or messaging apps, creating links with non-English characters, building URLs programmatically with user input, or working with API endpoints that require encoded parameters. For example, if you want to link to a search for "coffee & tea", encode it as "coffee%20%26%20tea" to ensure the URL works correctly.

What is URL decoding?

URL decoding converts encoded URLs back to human-readable format. When you see a URL with %20, %26, or other percent-encoded characters, decoding translates them back to spaces, symbols, and special characters. This helps you understand what an encoded URL actually says or represents. Decoding is useful for reading log files, understanding analytics data, debugging web applications, or simply making sense of messy-looking URLs.

What characters need to be encoded in URLs?

Characters that must be encoded include: spaces (become %20), special symbols like & (becomes %26), # (becomes %23), = (becomes %3D), ? (becomes %3F), non-English characters (é becomes %C3%A9), quotes (becomes %22 or %27), and many others. Safe characters that do NOT need encoding include: letters A-Z and a-z, numbers 0-9, and these symbols: - _ . ~ Our tool automatically identifies which characters need encoding and converts them properly.

What is the difference between encoding a full URL vs query string?

When encoding a full URL, you must preserve the structure (http://, domain, path separators /). Only special characters within each component get encoded. When encoding just a query string or parameter value, everything except safe characters gets encoded, including slashes and colons. For example, encoding "https://example.com/search?q=hello world" as a full URL encodes only the space: "https://example.com/search?q=hello%20world". Encoding the same string as a parameter value encodes everything: "https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world".

Can I decode multiple URLs at once?

Yes! Our URL encoder/decoder supports batch processing. Paste multiple URLs (one per line) and the tool processes them all simultaneously, showing each decoded or encoded result. This is perfect for processing log files, analytics exports, or bulk URL operations. You can encode or decode hundreds of URLs in seconds rather than processing them one by one.

Is URL encoding the same as HTML encoding?

No, URL encoding and HTML encoding are different. URL encoding uses percent signs (%) followed by hexadecimal codes (%20 for space, %26 for &). HTML encoding uses ampersand entities (  for space, & for &). URL encoding is for transmitting data in URLs. HTML encoding is for displaying special characters in web page content. They serve different purposes and use different encoding schemes. Do not confuse them or mix them.

What is double encoding and why is it a problem?

Double encoding happens when you encode an already-encoded URL. For example, encoding "hello%20world" again becomes "hello%2520world" (the % itself gets encoded to %25). This breaks URLs because the server decodes once, leaving %20 as literal text instead of interpreting it as a space. Always decode first before re-encoding, or check if your URL is already encoded. Double encoding is a common bug in web applications when encoding happens multiple times in the code.

How do I encode non-English characters in URLs?

Non-English characters (accents, Chinese, Arabic, emoji) are encoded using UTF-8 encoding to percent-encoded format. For example, the Spanish ñ becomes %C3%B1, Chinese 你好 becomes %E4%BD%A0%E5%A5%BD. Our tool automatically handles all UTF-8 characters correctly, converting them to the proper percent-encoded sequences. This ensures international characters work correctly in URLs regardless of language or alphabet.

Is this URL encoder/decoder tool free?

Yes! Our URL encoder and decoder is completely free with unlimited use. Encode and decode as many URLs as you need, process batch operations, handle special characters from any language, and get instant results. No registration required, no hidden fees, no limits. All features included at no cost forever.