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.
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.
# Encoding
printf 'Hello, World!' | jq -sRr @uri
# Output: Hello%2C%20World%21
# Decoding
printf 'Hello%2C%20World%21' | jq -sRr @urid
# Output: Hello, World!
// 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!
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!
}
// 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!