URL Encoder Decoder

Encode special characters in URLs or decode percent-encoded strings

Method:
Plain Text / URL
0 chars0 lines
Encoded URL
0 chars
📖 Documentation
URL Encoder Decoder Online Complete API
Full technical reference covering every mode, method, action, counter, and interaction. Understand how encoding and decoding works with detailed explanations and examples.
2
Modes
2
Methods
5
Actions
3
Counters
01overview

What Is the URL Encoder Decoder Tool?

The URL encoder decoder is a free browser-based utility that converts ordinary text into percent-encoded format and decodes percent-encoded strings back to their original form. URLs on the web allow only a restricted set of characters: letters, digits, hyphens, underscores, and periods. Characters like spaces, quotes, ampersands, question marks, brackets, carets, and non-ASCII symbols must be encoded as a percent sign followed by two hexadecimal digits. This tool handles both directions using JavaScript native functions encodeURIComponent, encodeURI, decodeURIComponent, and decodeURI. Everything runs inside your browser with zero server communication. You get two encoding methods to choose the right strictness for each use case, live counters that show exactly what happens to your data, and instant auto-updating results.

url-encoder Single-direction encoding tool
02mode-toggle

Encode URL vs Decode URL Mode

The mode toggle bar at the top of the tool contains two buttons that determine the direction of the conversion. Click Encode URL to activate encoding mode the input expects plain text and the output produces percent-encoded characters. Click Decode URL to reverse the operation the input accepts percent-encoded strings and the output returns readable text. Every interface element reflects the current mode. The input panel title switches between Plain Text / URL and Encoded URL. The output panel title updates accordingly. The Convert button text changes between Encode and Decode. The textarea placeholder adapts to guide you. The active button lights up with a teal gradient while the inactive button stays neutral, giving you an immediate visual cue. Switching modes preserves your input so you can encode and immediately switch to decode for verification.

Encode Mode
Plain text % encoded
Decode Mode
% encoded Readable
B
Base64 Encoder Decoder Another encoding tool for binary-to-text conversion
03method-select

EncodeURIComponent vs EncodeURI Method

The Method radio group below the mode bar controls how aggressively the tool encodes special characters. encodeURIComponent encodes every special character without exception, including :, /, ?, #, @, &, and =. This is the correct choice for encoding query parameter values, form fields, and hash fragments where no character should alter the URL structure. encodeURI preserves URL syntax characters colon, slash, question mark, hash, at sign, ampersand, and equals sign so the encoded string remains a functional web address. Select your method by clicking the radio button. The chosen option highlights with a teal border and background for clear visual feedback. Both methods handle the same unsafe characters: spaces, quotes, angle brackets, backslashes, carets, and non-ASCII text.

CharacterencodeURIComponentencodeURI
Space%20%20
Ampersand &%26Preserved
Equals =%3DPreserved
Question ?%3FPreserved
Slash /%2FPreserved
Hash #%23Preserved
Colon :%3APreserved
At @%40Preserved
B
Base64 Encoder Portable ASCII encoding for web and email data
04input-panel

Input Panel Paste, Type, and Clear

The input panel on the left accepts the text or URL you want to process. You can type directly into the monospace textarea. Click the Paste button in the panel header to read content from your clipboard using the Clipboard API it fills the textarea and triggers automatic conversion. The Clear button empties the input, resets the character and line counters to zero, and also clears the output panel. The placeholder text inside the textarea changes dynamically. In Encode mode it says Paste your URL or text here.... In Decode mode it says Paste encoded URL here (e.g. hello%20world). Every keystroke, paste, or clear event fires the conversion automatically through the oninput handler, keeping the output in sync without requiring extra clicks.

Auto-Update: The tool listens to the oninput event on the textarea. Every character you type, every paste, and every clear action immediately triggers the encoding or decoding function. The Convert button is available for explicit triggering but is rarely needed during normal use.
URL Opener — Open multiple URLs for batch testing
05convert-output

Convert Action and Output Panel

The Convert button sits between the two panels and displays an arrow followed by Encode or Decode depending on the active mode. Clicking it reads the input, applies the selected method, and writes the result to the output panel. The output panel displays the result in a readonly textarea with a light teal background to visually distinguish it from the input. The Copy button copies the result to your clipboard it briefly shows a checkmark for two seconds as confirmation, then reverts to the original label. The Clear button empties only the output panel without affecting the input, letting you reset the result while keeping your original text for further editing. The output panel title updates dynamically to show Encoded URL or Decoded URL based on the current mode.

📋
Copy Button
Checkmark 2s feedback
🗑
Clear Output
Output only, input stays
Regex Tester — Validate URL patterns with custom expressions
06swap-verify

Swap Feature and Round-Trip Verification

The Swap button performs three operations in a single click. It reads the current output, places it into the input textarea, and automatically switches the mode to the opposite operation. If you were encoding, Swap moves the encoded result to the input and changes to Decode mode so you can verify the round trip. If you were decoding, it does the reverse. The button refuses to operate when the output is empty or contains an error message, preventing accidental invalid swaps. This feature is essential for data integrity testing encode a string, swap, decode, and confirm the output matches your original input. Power users rely on this for every parameter encoding task.

Tip: Use Swap after every encoding operation. If decoding the swapped result produces your original text, the encoding is correct. Any discrepancy means the method or mode was wrong.
HTML Formatter Beautify HTML with encoded URL references
07live-counters

Live Counters Chars, Lines, and Size Diff

Below each textarea, the tool displays real-time counters that update as content changes. The input footer shows the character count and line count of the input. The output footer shows the character count of the result and a size difference indicator. When encoding, special characters expand from one to three characters (percent sign plus two hex digits), so the output is longer the indicator shows a plus sign and the number of added characters. When decoding, percent-encoded sequences collapse back to single characters, shown with a minus sign. If the lengths match, the indicator reads same size. This feedback helps you understand encoding overhead, which matters when working within browser URL length limits (typically 2000 characters) and server-side constraints.

#
Input Footer
Chars + Lines
#
Output Footer
Chars + Diff
URL Encoder Online — Quick encoding without mode toggle
08workflow

Complete Step-by-Step Workflow

1

Select Mode

Click Encode URL or Decode URL. The button highlights and all labels update.

2

Choose Method

Pick encodeURIComponent for strict or encodeURI for gentle encoding.

3

Enter Data

Type into the textarea or click Paste. Counters update live below.

4

Convert

Click Convert or let auto-update run. Result appears in output panel.

5

Copy Result

Click Copy in the output header. Checkmark confirms clipboard success.

6

Swap and Check

Click Swap to reverse the operation. Convert again to verify data integrity.

B
Base64 Encoding — Complementary layer for data safety
09use-cases

Real-World Applications

🌐

Form Submissions

Browsers encode form data automatically. Decode submitted values during testing to verify what users actually entered.

📋

API Parameters

REST APIs need encoded query strings. Encode search terms and filters before appending them to endpoint URLs.

💻

Share Links

Links with complex parameters must be encoded to survive email clients and messaging platforms without corruption.

📜

Data Export

Some tools export URL-encoded data. Decode to read values and re-encode after modifications for re-import.

H
HTML Formatter Organize documents with encoded URLs
10troubleshooting

Common Mistakes and Solutions

⚠️

Wrong Method Selection

Using encodeURI for parameters leaves & and = unencoded, breaking query strings. Always use encodeURIComponent for parameter values.

🔄

Double Encoding

Encoding an already-encoded string turns % into %25, producing garbled output. Decode first, then re-encode if needed.

💡

Display Without Decoding

Showing users %20 and %26 looks broken. Always decode before displaying URLs in user-facing text.

🔎

Skipping Round-Trip

Not verifying with Swap hides errors. Always swap and decode to confirm your original data is intact.

U
URL Opener Tool Test multiple links simultaneously
11faq

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI preserves URL syntax characters like : / ? # @ & = so the result stays a functional web address. encodeURIComponent encodes these characters too, making it correct for individual parameter values. Use encodeURI for whole URLs and encodeURIComponent for parameters.
Does the tool save or transmit my data?
No data is stored, logged, or transmitted. All processing runs in your browser using JavaScript. Disconnect from the internet after the first page load and the tool continues working offline, proving no data leaves your device.
What characters are unsafe in URLs?
Spaces, quotes, angle brackets, backslashes, carets, grave accents, curly braces, pipe symbols, and non-ASCII characters are unsafe. encodeURIComponent also treats : / ? # @ & = as unsafe because they have URL syntax meaning.
Why does encoded output get longer?
Each unsafe character becomes a percent sign plus two hex digits, expanding one character to three. The size difference indicator in the output footer shows exactly how many characters were added or removed.
Can I encode emojis and non-English text?
Yes. Emojis, accented characters, CJK, Cyrillic, and all Unicode are supported. Non-ASCII characters convert to UTF-8 byte sequences and each byte is percent-encoded. The emoji 😀 becomes %F0%9F%98%80.
What does %20 mean?
%20 is the percent-encoded representation of a space character. Spaces are not allowed in URLs, so every space in a URL parameter or path must be encoded as %20. Some browsers show + in query strings but the correct encoding is %20.
How to decode a URL with many parameters?
Paste the entire encoded URL, select Decode mode with encodeURI method, and click Convert. The tool decodes every percent-encoded segment. Use Swap to re-encode and verify the round trip is correct.
What happens with invalid percent sequences?
The tool wraps the operation in try-catch. Invalid sequences like %2G trigger a JavaScript error which is caught and displayed as a warning with the specific error description, helping you identify and fix the problem.
Regex Tester — Validate encoded URL patterns
12compat

Browser and Mobile Compatibility

The URL encoder decoder works on every modern browser and device without installation. On desktop screens, the two panels sit side by side with the Convert and Swap buttons between them for efficient keyboard and mouse workflows. On mobile devices, the layout stacks vertically input at top, control buttons in the middle, output at bottom so the tool remains fully usable on phones and tablets. Copy and Paste use the standard Clipboard API with fallback behavior for older browsers. The tool loads no external scripts beyond the Google Font, making it instant on any connection speed and fully functional offline after the initial visit. Textareas support vertical resize on desktop and smooth scrolling on mobile, accommodating long URL strings on any screen size.

🔗
base64-encoder-decoder Companion encoding tool