Calculators PlanetCalculators Planet
HomeFinancialMathHealthOtherBlogAboutContact
Calculators PlanetCalculators Planet

Fast, accurate, and user-friendly online calculators for all your needs.

Financial

  • Mortgage Calculator
  • Amortization Calculator
  • Mortgage Payoff Calculator
  • House Affordability Calculator
  • Rent Calculator

Math

  • Decimal to Fraction Calculator
  • Significant Figures Calculator
  • Percentage Calculator
  • Fraction Calculator
  • Ratio Calculator

Health

  • BMI Calculator
  • Ideal Weight Calculator
  • Body Fat Calculator
  • Calorie Calculator
  • Macro Calculator

Other

  • Age Calculator
  • Date Calculator
  • Time Calculator
  • Hours Calculator
  • Time Card Calculator

2026 Calculators Planet. All rights reserved.

BlogAboutContactPrivacy PolicyCookie PolicyTerms of ServiceDisclaimer
Calculators PlanetCalculators Planet
HomeFinancialMathHealthOtherBlogAboutContact
HomeOtherURL Encode / Decode

URL Encode / Decode

Convert plain text to URL-safe percent-encoding and decode URL-encoded strings back to their original text. Essential for web forms, API parameters, and query strings.

Share:
Text to URL Encode

0 characters

URL Encoded Output
URL Encoding Reference

Common characters that must be percent-encoded in URLs:

" "→ %20
"!"→ %21
"#"→ %23
"$"→ %24
"%"→ %25
"&"→ %26
"'"→ %27
"("→ %28
")"→ %29
"*"→ %2A
"+"→ %2B
","→ %2C
"/"→ %2F
":"→ %3A
";"→ %3B
"="→ %3D
"?"→ %3F
"@"→ %40

What Is URL Encoding?

Sarah, a backend developer in Seattle, is building a search API endpoint. A user types "coffee & tea" into a search box. If Sarah passes that string directly into a URL query parameter, the ampersand will split the parameter into two separate values. The server receives "coffee " and " tea" as distinct parameters instead of one search query. URL encoding solves this: "coffee & tea" becomes "coffee%20%26%20tea", and the server decodes it back to the original string without ambiguity.

URL encoding, also known as percent-encoding, converts unsafe characters into a format that can be safely transmitted over the internet. URLs can only contain a limited set of characters defined by RFC 3986. Any character outside the allowed set, such as spaces, special symbols, or non-ASCII characters, must be encoded as a percent sign followed by two hexadecimal digits. This encoding is essential for web forms, query parameters, and any data embedded in URLs. For encoding binary data, try our Base64 Encode / Decode tool.

What This Tool Does

This tool encodes plain text into URL-safe percent-encoded format and decodes percent-encoded strings back to their original form. It uses the standard encodeURIComponent and decodeURIComponent JavaScript functions, which handle the full UTF-8 character set including Unicode characters.

  • Encode inputs: Any plain text string, including spaces, symbols, and Unicode characters
  • Encode outputs: A percent-encoded string where unsafe characters are represented as %XX
  • Decode inputs: A percent-encoded string
  • Decode outputs: The original plain text

How the Encoding Works

URL encoding replaces each unsafe character with a percent sign followed by its byte value in hexadecimal. The UTF-8 encoding is used for non-ASCII characters, which may result in multiple percent-encoded bytes for a single character.

Space → %20

Hello World → Hello%20World

café → caf%C3%A9 (UTF-8: é = C3 A9)

? → %3F

Characters that are safe and do not require encoding include alphanumeric characters (A-Z, a-z, 0-9) and a few special characters like hyphen (-), underscore (_), period (.), and tilde (~). All other characters must be percent-encoded. RFC 3986 defines these unreserved characters and the full encoding rules. For generating secure random strings for API keys or passwords, use our Password Generator.

How to Use the Tool

  1. Select the URL Encode tab to convert plain text for safe use in URLs
  2. Paste or type your text in the input area
  3. Click Encode to see the percent-encoded output
  4. Use the Copy button to copy the result to your clipboard
  5. Switch to the URL Decode tab to convert a percent-encoded string back to plain text
  6. Paste the encoded string and click Decode

Example Calculations

Example 1: Sarah from Seattle encodes the search query "coffee & tea" for her API. The space becomes %20, the ampersand becomes %26, and the result is "coffee%20%26%20tea". She tests this in her Postman collection and confirms the server receives the correct single parameter value.

Example 2:Marcus, a frontend developer in Austin, needs to encode the string "price >= $100 & discount < 10%" for a query parameter. Every special character (>=, $, &, <, %) is percent-encoded: "price%20%3E%3D%20%24100%20%26%20discount%20%3C%2010%25". He verifies this with the tool before deploying his code.

Example 3: Priya, a localization engineer in San Francisco, encodes the French string "Café au lait" for an internationalized URL. The é character is encoded as two bytes (C3 A9) in UTF-8, resulting in "Caf%C3%A9%20au%20lait". She confirms the server decodes it correctly regardless of locale settings. For network-related calculations, try our IP Subnet Calculator.

Real World Scenarios

Web Form Submissions

Sarah from Seattle is debugging a form submission where user input containing special characters is breaking the server. When a user submits a web form with special characters, the browser automatically URL-encodes the data before sending it. Sarah uses this tool to manually construct test form data and debug encoding issues when the automatic encoding does not behave as expected. She discovers her JavaScript framework was double-encoding the data.

API Query Parameters

Marcus from Austin is building a REST API that accepts search queries with special characters. A search for "C++ & Python" would break the URL without encoding. He uses this tool to verify that "C%2B%2B%20%26%20Python" is the correct encoded form. URL encoding ensures the API receives the exact value intended, not a malformed request with split parameters.

Redirect URLs and Deep Links

Priya from San Francisco is building a redirect system that passes a target URL as a parameter. The target URL "https://example.com/search?q=hello world" must be encoded as "https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world" before being embedded in the redirect URL. Without encoding, the question mark and ampersand in the target URL would be misinterpreted as part of the redirect URL structure.

Common Mistakes to Avoid

  • Encoding the entire URL instead of just the parameters: Only parameter values and path segments containing unsafe characters should be encoded. The URL structure (protocol, domain, slashes, question marks, ampersands) must remain intact. Encoding the slashes in a URL path will break navigation.
  • Using encodeURI instead of encodeURIComponent: encodeURI leaves characters like ?, &, and = unencoded because they are part of URL syntax. For parameter values, always use encodeURIComponent. This tool uses encodeURIComponent, which is correct for query parameter values.
  • Double-encoding: Encoding an already-encoded string produces incorrect results. "%20" becomes "%2520" because the percent sign itself gets encoded. Always decode first if you are unsure whether a string is already encoded.
  • Assuming plus signs are spaces: Some legacy systems use + for spaces (application/x-www-form-urlencoded). Standard URL encoding uses %20. This tool uses %20 as per RFC 3986. If you need + for form data, replace %20 with + after encoding.
  • Treating URL encoding as encryption: URL encoding is reversible by anyone and provides zero security. It is purely for safe transmission. Never use it to hide or protect sensitive data. For secure password generation, use our Password Generator.

Limitations of This Tool

This tool uses JavaScript's encodeURIComponent and decodeURIComponent, which follow the RFC 3986 standard for percent-encoding. It does not handle the application/x-www-form-urlencoded encoding scheme (which uses + for spaces) common in HTML form submissions. It does not validate whether the decoded output is valid UTF-8, so decoding a malformed percent-encoded string may produce unexpected results. The tool does not encode full URLs with preserved structural characters; for that, use encodeURI in your own code. It does not handle URL normalization, IDN (internationalized domain name) conversion, or Punycode encoding. For related tools, try our Base64 Encode / Decode, Password Generator, or IP Subnet Calculator.

Authoritative Research and Resources

  • RFC 3986: Uniform Resource Identifier (URI): Generic Syntax is the official IETF standard that defines URL syntax, the unreserved character set, and percent-encoding rules. Published in 2005 by Tim Berners-Lee and colleagues, it remains the authoritative specification for URL encoding. Section 2.1 covers percent-encoding, and Section 2.2 defines reserved characters.
  • MDN Web Docs: encodeURIComponent() documents the JavaScript function this tool uses for encoding. It explains which characters are encoded, how Unicode characters are handled through UTF-8, and the difference between encodeURIComponent and encodeURI. MDN is maintained by Mozilla and is the standard reference for web platform APIs.
  • WHATWG URL Standard is the living standard that browsers follow for URL parsing and serialization. It updates and in some cases supersedes RFC 3986 for web contexts. The WHATWG standard defines how percent-encoding interacts with URL parsing in modern browsers, including handling of query strings and fragments.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI is for encoding an entire URL and leaves characters like /, ?, &, and = unencoded because they are part of URL syntax. encodeURIComponent is for encoding individual parameter values and encodes those characters. For query parameters, always use encodeURIComponent. This tool uses encodeURIComponent, which is correct for encoding parameter values but not full URLs.
Why are spaces encoded as %20 instead of +?
There are two conventions: %20 (standard URL encoding per RFC 3986) and + (application/x-www-form-urlencoded, used in HTML form submissions). Modern web APIs and REST frameworks expect %20. This tool uses %20 as per the URL specification. If you need + for form data, replace %20 with + after encoding. The WHATWG URL Standard also uses %20 for spaces in URLs.
Can URL encoding be used for encryption or security?
No. URL encoding is purely for making characters safe for transmission in URLs. It is reversible by anyone and provides no security whatsoever. It is not encryption, hashing, or obfuscation. For actual encryption, use algorithms like AES. For secure password generation, use a dedicated password generator. Never treat URL-encoded data as hidden or protected.
Why do some characters encode to multiple percent signs?
Non-ASCII characters (like é, 漢字, or emoji) are encoded using UTF-8, which may require multiple bytes. Each byte becomes its own percent-encoded sequence. For example, é in UTF-8 is two bytes (C3 A9), so it encodes to %C3%A9. A Chinese character might require three bytes, producing three percent-encoded sequences. An emoji can require four bytes.
What happens if I don't URL-encode special characters?
Unencoded special characters break URL parsing. Spaces truncate parameters, ? and & are misinterpreted as URL structure, and unencoded Unicode characters may be decoded incorrectly depending on server configuration. In the worst case, unencoded input can lead to injection vulnerabilities if the server does not properly sanitize the data. Always URL-encode dynamic data before inserting it into URLs.
What is double-encoding and how do I avoid it?
Double-encoding happens when you encode a string that is already percent-encoded. For example, %20 becomes %2520 because the percent sign itself gets encoded to %25. This is a common bug in web applications where multiple layers of code each apply encoding. To avoid it, always decode first if you are unsure whether a string is already encoded, or track the encoding state of your data through the processing pipeline.
Does this tool handle internationalized domain names (IDN)?
No. This tool handles percent-encoding of URL parameter values and path segments. Internationalized domain names (like example.中国) use Punycode encoding, which is a separate standard defined in RFC 3492. Modern browsers handle IDN conversion automatically. This tool does not perform Punycode conversion or IDN normalization.

Related Calculators

Base64 Encode / Decode

Encode text to Base64 and decode Base64 strings back to plain text

Password Generator

Generate strong, random passwords with custom length and character sets

IP Subnet Calculator

Calculate subnet mask, network address, broadcast address, and host range

Embed This Calculator

URL Encode / Decode

Calculate
Reset
Calculators PlanetCalculators Planet

Fast, accurate, and user-friendly online calculators for all your needs.

Financial

  • Mortgage Calculator
  • Amortization Calculator
  • Mortgage Payoff Calculator
  • House Affordability Calculator
  • Rent Calculator

Math

  • Decimal to Fraction Calculator
  • Significant Figures Calculator
  • Percentage Calculator
  • Fraction Calculator
  • Ratio Calculator

Health

  • BMI Calculator
  • Ideal Weight Calculator
  • Body Fat Calculator
  • Calorie Calculator
  • Macro Calculator

Other

  • Age Calculator
  • Date Calculator
  • Time Calculator
  • Hours Calculator
  • Time Card Calculator

2026 Calculators Planet. All rights reserved.

BlogAboutContactPrivacy PolicyCookie PolicyTerms of ServiceDisclaimer