This tool creates random strings you can use as passwords, API keys, tokens or test data, generated using your browser's Web Crypto API so the output is cryptographically strong rather than predictable like a basic random number function. You set the string length from 1 to 256 characters, how many strings to generate at once (from 1 up to 50), and the character makeup, either through a preset such as alphanumeric, hex, numeric only or URL-safe, or by ticking your own combination of uppercase letters, lowercase letters, digits and symbols. You can also add extra custom characters or exclude ambiguous ones such as 0, O, 1, l and I so strings are easier to read and type correctly. Once generated, the calculator shows the entropy in bits, the alphabet size used, the number of possible combinations as a power of ten, and a strength rating running from weak through to excellent, along with a full breakdown of length, quantity, character set and generation method. Use the strength bar as your guide: aim for at least 72 bits for a general password and 128 bits or more for API keys, tokens or anything security-sensitive. Everything runs locally in your browser and nothing is sent to any server, but for production secrets and long-term cryptographic keys, generate them in a secure server-side environment rather than relying on browser output alone.
This tool uses window.crypto.getRandomValues(), the Web Crypto API built into modern browsers. This is a cryptographically strong pseudo-random number generator (CSPRNG) that produces unpredictable output suitable for security-sensitive use cases such as passwords, API keys, and session tokens. It falls back to Math.random() only if the Web Crypto API is unavailable, which is noted in the output.
The algorithm works as follows: given a character alphabet of size N and a desired string length L, it generates L random integers in the range [0, N) using rejection sampling (to avoid modulo bias) and maps each to a character in the alphabet. The entropy of each string is L x log2(N) bits.
Entropy is a measure of unpredictability, expressed in bits. Higher entropy means more possible combinations, which makes brute-force guessing harder. The formula is:
Entropy = length x log2(alphabet size)
| Use Case | Recommended Entropy | Example Settings |
|---|---|---|
| General password | 72+ bits | Length 12, all chars (94-char set) |
| High-security password | 100+ bits | Length 16, all chars |
| API key / token | 128+ bits | Length 22, alphanumeric (62-char set) |
| Session token | 128+ bits | Length 32, hex (16-char set) |
| Cryptographic key | 256 bits | Length 44, alphanumeric or length 64, hex |
The generator supports these character groups:
The exclude field lets you remove ambiguous characters (such as 0, O, 1, l, I) that can be misread when printed or typed manually.
Default settings: length 24, alphanumeric preset (A-Z, a-z, 0-9 = 62 characters), 1 string.
A string of this type with 142.9 bits of entropy would take longer than the age of the universe to brute-force on current hardware.
Method: String entropy calculated as L x log2(N) where L = string length and N = alphabet size. Random values generated using window.crypto.getRandomValues() with rejection sampling to eliminate modulo bias. Strength thresholds based on NIST SP 800-63B guidance and general security practice.
This tool generates strings in your browser only. No strings are transmitted to any server. For production security use, always generate cryptographic secrets in a secure server-side environment using a trusted library. Do not use browser-generated strings as long-term cryptographic keys without additional key derivation.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
Calculate.co.nz is the sister site of CalculatorHub.com, the world's largest calculator website by tool count.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-07-19 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.