Half the "online tools" I used to Google are one line of built-in browser JS. Keeping these in your head (or a snippet file) saves a tab and keeps your data off random servers.
Random UUID (v4)
crypto.randomUUID(); // "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
Cryptographically random, built in. For bulk, just loop it.
HEX → RGB
const [r,g,b] = hex.match(/\w\w/g).map(h => parseInt(h,16));
URL encode / decode (the right one)
encodeURIComponent(value); // a single query value
encodeURI(fullUrl); // a whole URL, keeps / : ? & =
decodeURIComponent(s.replace(/\+/g,' '));
Base64 (UTF-8 safe)
btoa(unescape(encodeURIComponent(str))); // encode
decodeURIComponent(escape(atob(b64))); // decode
The naive btoa(str) throws on emoji/accents — the wrap fixes it.
JSON validate + format
JSON.stringify(JSON.parse(input), null, 2);
JSON.parse is your validator (it throws with the position).
I got tired of pasting into sketchy sites, so I made no-signup, runs-in-your-browser versions of these — handy when you want a UI but don't want to ship your data anywhere:
- UUID generator: https://tsetsobg.github.io/tools/uuid-generator
- Hex → RGB → HSL: https://tsetsobg.github.io/tools/hex-to-rgb-converter
- URL encoder/decoder: https://tsetsobg.github.io/tools/url-encoder-decoder
- JSON formatter: https://tsetsobg.github.io/tools/json-formatter
What's the one "online tool" you reach for that's secretly a browser one-liner?
Top comments (0)