[jq] URL-encode a string

Created on November 30, 2026

Use @uri to percent-encode text. The -R option reads raw text instead of parsing JSON, and -r prints the encoded string without JSON quotes.

echo 'hello world?name=Taro Suzuki' | jq -Rr '@uri'
hello%20world%3Fname%3DTaro%20Suzuki
jq