Yes. You can generate a JWT secret on an iPhone or an Android phone in the browser you already have, with no app to install and no account to create. The generator uses the Web Crypto API, so the random bytes come from your phone's own operating system, and it keeps working once the page is open, even with no signal. The steps are the same on both platforms: open the generator, choose HS256, HS384 or HS512, tap Generate secret, then copy the key into a place you trust. What needs care is not the generation step; it is where the key goes next. Below are the exact taps for iOS and Android, the lengths each algorithm needs, and the phone storage options that are actually safe.
Does the generator work in mobile Safari and Chrome?
Yes. The generator is a normal web page, not an app, so an iPhone, iPad or Android phone can open it in Safari, Chrome, Edge, Firefox or any other current browser. There is nothing to install, no account to sign in to, and no permission prompt beyond the one your browser may show when the page writes to the clipboard. The page creates a key as soon as it loads and gives you a Generate secret button, which becomes Regenerate after the first key, for as many fresh keys as you need.
Because the calculation happens in JavaScript on the device, the key does not depend on the network once the page is open. That also means a phone generates exactly the same kind of key a laptop does: the algorithm and the Web Crypto API are the same, only the screen is smaller.
If Copy key does nothing, the browser refused clipboard access. The tool then shows a Show and select button so you can copy by hand: tap it, then tap and hold the highlighted text and choose Copy from the menu. This fallback works in Safari and Chrome alike.
How do I generate and copy a JWT secret on iPhone?
The whole job takes about a minute in Safari.
- Open the generator. Tap the address bar, type
jwtsecretkeygenerator.org, and press Go. No extension or app is needed. - Pick the algorithm. HS256 is selected by default and is the usual choice. Tap HS384 or HS512 only if the services that verify the token expect them; each algorithm has its own minimum key length.
- Generate the key. A key already exists when the page loads. Tap Generate secret, which reads Regenerate after the first click, until you have a value you have not used anywhere else.
- Reveal and copy. Tap Show to display the key, then tap Copy key. The status line says "Copied." when the value is on the iOS clipboard. If the button does not respond, use Show and select as described above.
- Paste it where it belongs. Open Notes, create a new note, tap and hold in the note, and choose Paste. For a key you want stored securely, put it in the Passwords app or another password manager instead of a plain note; the storage section below compares the options.
iOS shares the clipboard with other apps and can sync it to a Mac through Universal Clipboard. The first time a different app pastes, iOS may ask whether to allow it; only allow the app you intended. After the key is saved, copy a harmless word over the clipboard so the secret does not sit there for the next app to read.
How do I generate and copy a JWT secret on Android?
Chrome on Android follows the same sequence, with slightly different clipboard behavior.
- Open the generator. Tap the address bar, type
jwtsecretkeygenerator.org, and press Enter on the keyboard. Chrome works without an app or a login. - Choose the algorithm. Leave HS256 selected, or tap HS384 or HS512 if your token verifier uses one of them.
- Generate the key. Tap Generate secret and keep tapping Regenerate until the value is new to you. The key is created locally each time.
- Copy it. Tap Show, then Copy key. On Android 13 and later a clipboard preview appears at the bottom of the screen; that is your phone confirming the copy, not a message from the site.
- Paste into a password manager. In Bitwarden, tap + and choose Secure note. In 1Password, tap + and choose Password or Secure note. In KeePassDX, open the database and add an entry. If a manager only accepts web logins, save the key as the password of an entry named for the service, such as "prod JWT HS512".
- Clear the clipboard. Copy a harmless sentence over it, then close the tab if you are finished.
Some Android keyboards keep a clipboard history. Check the keyboard settings and turn that history off, or paste the key only through the password manager's own paste button, so the value does not linger in a keyboard log. If you use a borrowed or shared phone, clear the clipboard and close the password manager before handing it back.
Why is generating on a phone safer than pasting a key into a random page?
The danger with an existing key is not the page you found it on; it is every page that asks you to paste it. A text field can read whatever you put in it, and that page can send the value anywhere without asking again. A generator that creates the key locally never needs your old secret, so there is nothing to paste and nothing to intercept. If a site offers to "check the strength" of a key you already have, that is not a generator: a strength check only needs the length and format, never the secret itself.
Phones add a few protections that desktops do not. Apps run in a sandbox and cannot read another app's memory, iOS asks before an app pastes from the clipboard, and Android 13 shows a clipboard preview so you can see when something is read. Mobile browsers also carry far fewer extensions than a desktop browser, which removes a common way for a page's content to be observed. What phones add instead is physical exposure: shoulder surfing on a train, a shared device, a screenshot that syncs to cloud photos, or a chat notification that shows a pasted line. Use a passcode and biometrics, avoid screenshots of the key, and send the value only through a password manager or a channel you control.
How long should the key be on a phone?
The minimum depends on the signing algorithm: 32 bytes for HS256, 48 bytes for HS384 and 64 bytes for HS512, as required by RFC 7518 section 3.2. The generator sets the matching minimum when you pick an algorithm and lets you raise the length up to 256 bytes. On a phone, Base64URL is the easiest encoding to copy, because it contains no plus sign, slash or equals sign that some shells and .env files mishandle.
| Algorithm | Bytes | Hex characters | Base64URL characters |
|---|---|---|---|
| HS256 | 32 | 64 | 43 |
| HS384 | 48 | 96 | 64 |
| HS512 | 64 | 128 | 86 |
If your application expects a Base64 or Base64URL string, keep the encoding consistent on both sides. A 32-byte key copied as 64 Hex characters is the same key as the 43-character Base64URL version, but the receiving code has to decode it before signing. If you also inspect tokens on the phone, the JWT decoder accepts a pasted token in the same mobile browser.
Where should I keep a JWT secret on a phone?
For a development or staging key, a password manager is the most practical place, and both phone platforms have workable options:
- iPhone, Passwords app or iCloud Keychain. Add an entry, put the key in the password field, use the username field as a label such as "staging JWT HS256", and write the algorithm and rotation date in the notes. Entries sync through your Apple ID, so protect that account with two-factor authentication.
- iPhone, locked note. A note in Notes can be locked with Face ID or a passcode: tap the share or more button, choose Lock Note, and set the protection. A locked note is better than a plain note, but a password manager keeps the value together with the rest of your credentials.
- Android, Bitwarden or similar. Use a secure note, or a password entry whose username names the environment and algorithm. Enable biometric unlock so the master password is not typed in public.
- Android, KeePassDX. The database is a local file you control, which suits people who do not want cloud sync. Keep a backup of the database somewhere safe, because losing it means losing the key.
For a production signing key, the phone is not the primary store. The authoritative copy belongs in the server's secret manager, KMS or environment configuration, and the phone should hold a copy only if operations genuinely need one. Never keep the only copy in Photos, a chat app, an email draft, or an unlocked note.
Frequently asked questions
Is a JWT secret generated on a phone random enough?
Yes. iOS Safari and Android Chrome use the same Web Crypto API and the same operating system entropy pool as a desktop browser. A 32-byte key holds 256 bits of entropy no matter which device produced it, so a phone is not weaker here. The real risks on a phone are observation and storage: someone reading the screen, a clipboard that keeps history, or a key saved in a plain note that syncs everywhere.
Can I store the key in iCloud Keychain?
You can save it as the password of an entry in the Passwords app, or under Settings and then Passwords on older iOS versions. iCloud Keychain encrypts entries and syncs them through your Apple ID, which should have two-factor authentication turned on. That is reasonable for a development key. For a production signing key, keep the authoritative copy in the server's secret manager: a synced phone copy adds an attack surface, and every device approved for the same Apple ID can read it.
Which password manager should I use on Android?
Any well-maintained manager that supports secure notes will do: Bitwarden, 1Password, KeePassDX, Proton Pass and similar. Bitwarden is free and open source, 1Password is polished, and KeePassDX keeps the database as a local file you control. Whichever you pick, turn on biometric unlock, set a strong master password, and store the key in a secure note with the algorithm and rotation date written next to it. Google Password Manager is built around website logins; if it will not accept a note for you, use one of the dedicated managers for this value.
Can I generate a JWT secret without internet access?
Yes, as long as the generator page is already open in the browser. The random bytes come from the phone, so tapping Regenerate in airplane mode still produces a new key. Loading the page for the first time needs a connection. If you generate keys offline regularly, open the page once while online and keep the tab, or use a local command-line tool such as openssl on a laptop.
On a bigger screen, the same job is faster in the JWT key generator, and decoding a JWT token tells you whether the key works.
Related guides
- Is an online JWT secret generator safe?
- Generate a JWT secret in Node.js
- How long should a JWT secret be?