URL Encoder & Decoder

Decode URL

About URL Encoding

What is URL encoding?

URL percent-encoding represents UTF-8 text with %HH byte escapes. This tool follows encodeURIComponent behavior: letters, digits, and -_.!~*'() remain readable, while other bytes, including URL delimiters and non-ASCII text, are escaped.

Why use URL encoding?

Encode individual path segments or query values before assembling a URL so spaces, &, =, ?, and Unicode cannot change its structure. This tool does not parse a complete URL or treat + as a space, rejects malformed % sequences, and provides encoding rather than encryption.

URL Encoding in Bash

# Encoding
printf 'Hello, World!' | jq -sRr @uri
# Output: Hello%2C%20World%21

# Decoding
printf 'Hello%2C%20World%21' | jq -sRr @urid
# Output: Hello, World!
			

URL Encoding in JavaScript

// Encoding
let encoded = encodeURIComponent("Hello, World!");
console.log(encoded);
// Output: Hello%2C%20World%21

// Decoding
let decoded = decodeURIComponent("Hello%2C%20World%21");
console.log(decoded);
// Output: Hello, World!
			

URL Encoding in Go

package main
import (
	"fmt"
	"net/url"
)
func main() {
	// Encoding
	encoded := url.QueryEscape("Hello, World!")
	fmt.Println(encoded)
	// Output: Hello%2C+%21World%21 (QueryEscape uses + for spaces)

	// Decoding
	decoded, _ := url.QueryUnescape("Hello%2C%20World%21")
	fmt.Println(decoded)
	// Output: Hello, World!
}
			

URL Encoding in PHP

// Encoding
$encoded = urlencode("Hello, World!");
echo $encoded . "\n";
// Output: Hello%2C+%21World%21

// Decoding
$decoded = urldecode("Hello%2C%20World%21");
echo $decoded . "\n";
// Output: Hello, World!