SlugGenerator.app

URL Encoder / Decoder

Encode or decode URLs, query parameters, and special characters. Everything runs in your browser.

0 characters
0 characters
encodeURIComponent / decodeURIComponent β€” encodes all special characters

What Is URL Encoding?

URL encoding (percent-encoding) converts characters into a format that can be safely transmitted in a URL. Characters like spaces, ampersands, and non-ASCII letters are replaced with a percent sign followed by two hex digits β€” for example, a space becomes %20.

When Do You Need URL Encoding?

  • Passing user input as query parameters (?q=hello%20world)
  • Including special characters in URL paths
  • Encoding non-ASCII characters (Chinese, Japanese, Arabic) in URLs
  • Building API requests with dynamic values
  • Fixing broken links caused by unescaped characters

encodeURIComponent vs encodeURI

JavaScript provides two built-in functions for URL encoding. encodeURIComponent() encodes all special characters including :, /, ?, #, and &. Use it for encoding individual query parameter values. encodeURI() preserves URL structure characters and only encodes characters that are invalid in any part of a URL. Use it when encoding a complete URL.

Common URL Encoding Examples

  • Space β†’ %20 (or + in form data)
  • & β†’ %26
  • = β†’ %3D
  • ? β†’ %3F
  • # β†’ %23
  • / β†’ %2F

URL Decoding

URL decoding reverses percent-encoding back to the original characters. This is useful when reading log files, debugging API requests, or extracting readable text from encoded URLs. Switch to decode mode above to convert any percent-encoded string back to plain text.

URL Encoding for Different Languages

Non-ASCII characters like ζ—₯本θͺž, Ü, or cafΓ© are first converted to their UTF-8 byte sequences, then each byte is percent-encoded. Modern browsers handle this automatically in the address bar, but API calls and backend code often require explicit encoding.

Related Tools

For creating clean URL slugs, use the URL Slug Generator. For converting text formats, try the Case Converter. For cleaning text before encoding, see the Plain Text Converter.

Related Tools

/

Slug Generator

Convert text to URL slugs

πŸ”—

URL Slug Generator

Create SEO-friendly URL slugs

πŸ“

Text to Slug

Transform any text into a slug

⚑

Slugify Online

Slugify text instantly online

πŸ”’

Permalink Generator

Create clean permanent URLs

🌐

WordPress Slug Generator

Generate slugs for WordPress

✍️

Blog Slug Generator

Generate slugs for blog posts

🏷️

Product Slug Generator

Generate slugs for product pages

Aa

Case Converter

Convert text to any case format

aA

CamelCase Converter

Convert text to camelCase

Tt

Title Case Converter

Capitalize text in title case

Ss

Sentence Case Converter

Convert text to sentence case

k-c

Kebab Case Converter

Convert text to kebab-case

s_c

Snake Case Converter

Convert text to snake_case

Pc

PascalCase Converter

Convert text to PascalCase

aLt

Alternating Case

Convert text to aLtErNaTiNg CaSe

d.c

Dot Case Converter

Convert text to dot.case

C_C

Constant Case Converter

Convert text to CONSTANT_CASE

πŸ”’

Word Counter

Count words, characters & sentences

πŸ“„

Lorem Ipsum Generator

Generate placeholder text

πŸ“‹

Plain Text Converter

Strip formatting, clean text

βœ‚οΈ

Duplicate Line Remover

Remove duplicate lines from text

⊟

Remove Empty Lines

Remove blank lines from text

↕️

Sort Lines Alphabetically

Sort text lines A-Z or Z-A

↩️

Remove Line Breaks

Join lines into one paragraph

β€”

Em Dash Remover

Replace em dashes with commas or hyphens

πŸ‘

Invisible Character Detector

Find hidden Unicode characters with code points

πŸ“Š

UTM Builder

Build campaign tracking URLs

{}

JSON Keys to camelCase

Convert JSON keys to camelCase

{_}

JSON Keys to snake_case

Convert JSON keys to snake_case