# Token Generator Guide

Generate random tokens and passwords of a chosen length and charset.

- Tool: https://ilham.dev/tools/token-generator/
- Guide URL: https://ilham.dev/guides/token-generator/
- Tool guides index: https://ilham.dev/guides/tools/
- Broader guide: Security and Cryptography Basics for Developers (https://ilham.dev/guides/security-cryptography-basics/)

## What it does

Generate random tokens and passwords of a chosen length from a chosen character set, drawn from the browser's cryptographic random source. Useful for API keys, session secrets and share links.

## Use the tool

Open https://ilham.dev/tools/token-generator/, add the input the tool asks for, run it, and check the output before using it elsewhere.

## Input and output

- Input: text.
- Output: text.
- Category: Crypto.

## Privacy and processing
Processing happens locally in your browser. This tool does not upload the input to ilham.dev.

## Questions

### How long should a token be?

For a machine-generated secret, 32 characters from a mixed alphabet is about 190 bits of entropy, which is far past brute force. Length buys you more than character variety does.

### Is Math.random good enough for this?

No. Math.random is a fast seeded generator whose output can be predicted from previous values. This tool uses crypto.getRandomValues instead.