Small tools. Better flow.

Secrets & tokens

Generate cryptographically random secrets for your service.

Usage guide

Your input stays in this browser.

Input & options

1–1,024 bytes; up to 100 values per batch

View code examples ↓

Result

Your result will appear here.

Code examples

Starting points for your own code. Run them in the environment shown below.

Node.js 22+ · ES module (.mjs)

Current inputs apply only to fields used by the example. Selected files are not embedded.

import { randomBytes } from "node:crypto";
const bytes = 32;
console.log(randomBytes(bytes).toString("base64url"));
console.log(randomBytes(bytes).toString("hex"));

Put it to work

Encode 32 bytes as Base64URL to get a 43-character unpadded secret.

Details that matter

Format and meaning

Bytes measure the random input. Hex uses two characters per byte.

Using it correctly

Base64 uses + and /, which may require URL escaping. Choose Base64URL for URLs.

Common pitfalls

This does not issue API keys for external services. Use the values in your own server configuration.

Supported scope and limits

1–1,024 bytes; up to 100 values per batch

Split inputs that exceed the limit. If a format or algorithm is unsupported, choose a tool that matches your requirements instead of silently changing the format.