URL Encoder

URL Encoder

Encode text to URL-safe format using percent encoding. Converts special characters to %XX format for safe transmission in URLs, query parameters, and API calls.

url
encode
web
Share this tool:
Quick Presets
Common text samples for quick encoding
Input
Enter plain text to convert to URL-safe format
0 characters
How it works: URL encoding (percent-encoding) converts characters that are not allowed in URLs into a % followed by two hexadecimal digits. For example, a space becomes %20, and & becomes %26. Uses encodeURIComponent() which encodes all characters except A-Z, a-z, 0-9, -, _, ., !, ~, *, ', (, ).

Complete Guide: URL Encoder

Everything you need to know about using this tool effectively

What is URL Encoder?

The URL Encoder converts plain text into URL-safe format using percent encoding. Special characters like spaces, ampersands, and non-ASCII characters are replaced with a percent sign followed by two hexadecimal digits (e.g., space becomes %20). The tool uses encodeURIComponent() for safe encoding of URL components. All processing happens in the browser.

This tool takes your text and converts every character that is not a letter, digit, or one of - _ . ! ~ * ' ( ) into its UTF-8 byte sequence, then represents each byte as %XX. This produces a string that is safe to use in URLs, query parameters, and API calls.

Key Features
Encodes text to URL-safe percent encoding
Uses encodeURIComponent for safe URL component encoding
Handles all Unicode characters
Quick preset examples
Copy encoded output to clipboard
Shows character count before and after
Runs in the browser with no uploads
Real-time encoding
Common Use Cases
When and why you might need this tool

Encoding query parameters

Encode user input or special characters before adding them to a URL query string.

Preparing data for API calls

Encode values that will be sent as URL parameters in REST API requests.

Creating mailto links

Encode subject lines and body text for use in mailto: links.

Debugging URL issues

Check how a string should look when properly encoded for use in a URL.

How to Use This Tool
Step-by-step guide to get the best results
1

Enter your text

Type or paste the text you want to encode.

2

Encode

Click Encode. The tool converts special characters to percent-encoded format.

3

Copy the result

Copy the encoded string for use in your URL, API call, or code.

Pro Tips
1

Spaces become %20 in URL encoding.

2

Use encodeURIComponent() for query parameter values, not encodeURI().

3

Always encode user input before including it in a URL.

4

The encoded output is longer than the input because special characters expand to 3 characters each.

Frequently Asked Questions
What is URL encoding?

URL encoding (also called percent encoding) converts characters that are not allowed in URLs into a percent sign followed by two hexadecimal digits. For example, a space becomes %20, and an ampersand becomes %26.

When should I encode a URL?

Encode text before adding it to a URL as a query parameter, path segment, or form value. This ensures special characters do not break the URL or get misinterpreted by the server.

Is my text sent to a server?

No. All encoding happens in your browser using JavaScript's encodeURIComponent() function. Nothing is transmitted.

What is the difference between encodeURI and encodeURIComponent?

encodeURI() encodes a full URL but keeps URL structure characters like : / ? & intact. encodeURIComponent() encodes everything except A-Z, a-z, 0-9, and - _ . ! ~ * ' ( ). Use encodeURIComponent for query parameter values.

Can I decode the result?

Yes. Use a URL decoder to reverse the percent encoding and get back the original text.