Skip to Content

🔐 URL Encoder/Decoder

A tool that encodes special characters for safe use in URLs or decodes encoded URLs back to original text.

📝 Input Text

✨ Result

💡 Examples

Original:
https://example.com/search?query=헬로 월드&lang=ko
Encoded:
https%3A%2F%2Fexample.com%2Fsearch%3Fquery%3D%ED%97%AC%EB%A1%9C%20%EC%9B%94%EB%93%9C%26lang%3Dko

URL encoding converts special characters into percent-encoded format for safe transmission in URLs. Use Encode to convert special characters, and Decode to restore the original text.

Key Features

1. URL Encoding (Encode)

Converts special characters, Korean, spaces, etc. to percent encoding format (%XX).

Example:

Original: https://example.com/search?query=hello world&lang=en
Encoded: https%3A%2F%2Fexample.com%2Fsearch%3Fquery%3Dhello%20world%26lang%3Den

2. URL Decoding (Decode)

Converts percent-encoded URLs back to readable original text.

Example:

Encoded: hello%20world
Decoded: hello world

3. Convenient Features

  • Swap Text: Quickly swap input and result
  • Copy: Copy result to clipboard
  • Clear: Clear all inputs at once

Why URL Encoding is Necessary

Safe URL Transmission

URLs have characters with special meanings:

  • / : Path separator
  • ? : Query start
  • & : Parameter separator
  • = : Key-value separator
  • # : Fragment

To transmit these characters as data, encoding is necessary.

Korean and Multilingual Text

Original: https://example.com/search?keyword=hello
Encoded: https://example.com/search?keyword=hello

Korean or special characters cannot be used directly in URLs, so encoding is essential.

Usage Examples

Web Development

// Creating URL in JavaScript
const searchQuery = "hello world";
const encodedQuery = encodeURIComponent(searchQuery);
const url = `https://api.example.com/search?q=${encodedQuery}`;
// Result: https://api.example.com/search?q=hello%20world

API Calls

# Original URL (won't work)
GET https://api.example.com/users?name=John Doe&age=30

# Encoded URL (works properly)
GET https://api.example.com/users?name=John%20Doe&age=30

Query Parameters

# Search term with special characters
Original: search=C++ & Java
Encoded: search=C%2B%2B%20%26%20Java

Characters That Get Encoded

Always Encoded Characters

  • Space: %20
  • Korean/Chinese: Each character encoded as multiple bytes
  • Special Characters: !, @, #, $, %, ^, &, *, (, ), =, +, [, ], {, }, etc.

Examples

!     → %21
@ → %40
# → %23
$ → %24
% → %25
& → %26
= → %3D
+ → %2B
Space → %20

Use Cases

🌐 Web Development

  • Search Functionality: Convert user input to URL queries
  • API Calls: Encode GET request parameters
  • File Names: Handle file names with special characters
<!-- mailto link with subject and body -->
<a href="mailto:test@example.com?subject=Hello&body=Inquiry">
<!-- After encoding -->
<a href="mailto:test@example.com?subject=Hello&body=Inquiry">

🔗 Social Media Sharing

// Facebook share URL
https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fexample.com&quote=Great%20article

// Twitter share URL
https://twitter.com/intent/tweet?text=Amazing%20news&url=https%3A%2F%2Fexample.com

📊 Data Analysis

  • Log Analysis: Interpret encoded URLs in web server logs
  • Tracking URLs: Interpret parameters from Google Analytics, etc.

Tips

When to Encode?

  • Query parameter values: ?search=needs encoding
  • Korean/special characters: name=John Doe
  • Spaces: query=hello world
  • Domain: https:// (already safe characters)
  • Path separators: /api/users (intentional separators)

Full URL vs Parameters Only

// ❌ Wrong way: Encode entire URL
const wrong = encodeURIComponent("https://example.com/search?q=hello");
// Result: https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello

// ✅ Right way: Encode only parameter values
const query = encodeURIComponent("hello");
const correct = `https://example.com/search?q=${query}`;
// Result: https://example.com/search?q=hello

Beware of Double Encoding

Original: hello
1st encoding: hello
2nd encoding: hello

// Don't encode the same text twice!

Usage by Programming Language

JavaScript

// Encoding
const encoded = encodeURIComponent("hello");
// Decoding
const decoded = decodeURIComponent(encoded);

Python

from urllib.parse import quote, unquote

# Encoding
encoded = quote("hello")
# Decoding
decoded = unquote(encoded)

Java

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

// Encoding
String encoded = URLEncoder.encode("hello", "UTF-8");
// Decoding
String decoded = URLDecoder.decode(encoded, "UTF-8");

PHP

// Encoding
$encoded = urlencode("hello");
// Decoding
$decoded = urldecode($encoded);

FAQ

Q: Which part of the URL should I encode? A: Only encode the values in query parameters. Don't encode the protocol (https://), domain, or path separators (/).

Q: Space is shown as both %20 and +, what's the difference? A: %20 can be used anywhere in the URL, while + represents space only in query parameters. Generally, using %20 is safer.

Q: I'm getting decoding errors. A: The input text may not be in proper URL encoding format, or it may already be decoded text. Please check the original encoded URL again.

Q: What happens if I encode an already encoded URL? A: Double encoding occurs, resulting in unintended results. For example, %20 becomes %2520. Only encode once.