URL encoder

5 of 1 ratings

URL-encode text online to safely place it inside web addresses and query strings. This URL encoder (a.k.a. percent-encode tool, URI encoder) converts reserved/special characters into %HH hex sequences—perfect for encode URL parameters online, escape URL special characters, make a URL-safe string, and percent-encode emojis & non-ASCII.

What is URL encoding (percent-encoding)?

URL encoding replaces characters that aren’t safe in a URL with a % followed by two hex digits (the byte value). By RFC 3986, only a small set is “unreserved” (A–Z a–z 0–9 - . _ ~). Everything else—spaces, quotes, ampersands, slashes (context-dependent), Unicode letters like ç, ğ, ş, and even emoji—should be percent-encoded when used in certain URL parts. Long-tail terms you might search for include “percent-encode URL characters online”, “URI encoder for query params”, and “URL safe string generator”.

How to use the URL Encoder

  1. Paste text (a query value, path segment, or full address) or upload a file to encode its contents.
  2. Choose scope:
    • Component (recommended): encode a single value (e.g., search term) for use after ? or inside a path segment.
    • Whole URL (advanced): keep reserved delimiters (:, /, ?, #) intact, encode the rest.
  3. Encoding options:
    • UTF-8 (default and best practice for URL encoding online).
    • Form mode (application/x-www-form-urlencoded): space → +, others → %HH.
    • Strict RFC 3986: space → %20 (never +), ideal for encode URL path or APIs.
  4. Click Encode and copy your percent-encoded output.

When should you use it?

  • Query strings: encode URL parameters like ?q=hello world&page=1.
  • Path segments: turn user input into a safe URL path (/users/ahmet yılmaz → /users/ahmet%20y%C4%B1lmaz).
  • Fragments & anchors: encode #section values with spaces or Unicode.
  • APIs & webhooks: percent-encode JSON snippets, tokens, or IDs placed in a URL.

Best practices & pitfalls

  • Encode components, not entire URLs: Usually encode just the value (after =) or a single path piece. Over-encoding can break delimiters.
  • Avoid double-encoding: % signs should not become %25 again. If you see %2520, you encoded twice.
  • Space: %20 vs +: Use + only for form-encoded query parameters; use %20 for paths and strict RFC 3986.
  • UTF-8 everywhere: Ensure input is UTF-8 so letters like ç, Äź, Ĺź, ö, ĂĽ, ı and emoji encode consistently.
  • Reserved vs unreserved: Don’t encode - . _ ~; do encode quotes, spaces, &, =, ? (inside values), etc.

Examples

Encode a query parameter (URL query string encoder)

Input:   q=çığ testi & sort=a&z
Value:   "çığ testi & sort=a&z"

Encoded (RFC 3986): %C3%A7%C4%B1%C4%9F%20testi%20%26%20sort%3Da%26z
Use in URL:        ?q=%C3%A7%C4%B1%C4%9F%20testi%20%26%20sort%3Da%26z

Encode a path segment (escape URL special characters)

Input path piece:  Café Crème/2025
Encoded segment:   Caf%C3%A9%20Cr%C3%A8me%2F2025
As URL path:       /menu/Caf%C3%A9%20Cr%C3%A8me%2F2025

Form mode (space → +) vs strict

Text:   hello world + coffee
Form:   hello+world+%2B+coffee
Strict: hello%20world%20%2B%20coffee

Emoji & non-ASCII (percent-encode Unicode)

Input:  I love pizza 🍕 & döner
Output: I%20love%20pizza%20%F0%9F%8D%95%20%26%20d%C3%B6ner

Code snippets (encodeURIComponent vs encodeURI, and more)

// JavaScript (URL encode string online logic)
encodeURIComponent("a&b=1 2");  // "a%26b%3D1%202"
encodeURI("https://ex.com/a b");  // "https://ex.com/a%20b"
// Tip: use encodeURIComponent for parameter values; encodeURI for the whole URL (keeps : / ? #)

// Node.js build
const { URLSearchParams } = require('url');
new URLSearchParams({ q: "çığ testi", page: "1" }).toString();
// "q=%C3%A7%C4%B1%C4%9F%20testi&page=1"

// Python
from urllib.parse import quote, quote_plus
quote("hello world & tea", safe="")       # "hello%20world%20%26%20tea" (RFC 3986)
quote_plus("hello world & tea")          # "hello+world+%26+tea" (form mode)

// PHP
rawurlencode("Café Crème")   // "Caf%C3%A9%20Cr%C3%A8me"
urlencode("a b & c")      // "a+b+%26+c" (form mode)

// PowerShell
[uri]::EscapeDataString("Türkçe şğ")  # "T%C3%BCrk%C3%A7e%20%C5%9F%C4%9F"

// cURL (build query safely)
curl -G --data-urlencode "q=çığ testi" --data-urlencode "page=1" https://example.com/search

FAQ

URL encoding vs HTML escaping vs Base64—what’s the difference?

URL encoding makes data safe for URLs (%20 for space). HTML escaping makes text safe for HTML (&, <). Base64 turns bytes into ASCII for transport. Use the right one for your context.

Why do I see %2520 instead of %20?

That’s double-encoding:

Similar tools

URL decoder

Decode URL input to back to a normal string.

5
0

Popular tools