PassGen.co

Language

All tools
All tools
All tools

UUID and API Key Generator

Made on this device with your browser’s secure random numbers. Never sent, never stored, and it works offline.

Check a UUID

Paste a UUID or GUID in any format to see its version and, for versions 7, 6, and 1, when it was made.

Format

Each one

Base64 is the 16 bytes in standard order. Downloads in .csv and .json leave out the quotes.

Characters

Base64url is safe in addresses, headers, and file names. Letters and digits only fits a double-click select and any system.

Written as

The same random bytes, only written differently.

Digits

A new code every

Algorithm

Keep 6 digits, 30 seconds, and SHA-1 unless your app needs others: many authenticator apps ignore other values without saying so, and their codes then never match.

Characters

Options

In the pattern, X is a random character from the set above and # a digit. Anything else stays as you typed it; put \ before an X or # to keep it.

UUIDs, API Keys, and Secrets, Made on Your Device

A UUID generator, an API key generator, and the secret keys frameworks ask for, in one place. Pick UUID for IDs, API key for tokens and random strings, Secrets for a JWT, WordPress, Django, Laravel, or AES key, 2FA to set up or test two-factor codes, or Backup codes for backup and coupon codes.

Every value comes from your browser’s secure random number generator, on this device. Nothing you make is sent anywhere or saved. The page address holds only your settings, so a bookmark or a shared link makes the same kind of key, never the same key.

Jump to: UUID v4 or v7 · Formats · API key length · Framework secrets · 2FA codes · Backup and coupon codes · Keeping keys safe · Questions

UUID Version 4 or Version 7?

Version 4 is random from end to end: nothing in it says when or where it was made. Version 7 starts with the time it was made, so a list of them sorts in the order they were created. In a version 7 UUID:

  • The first 12 characters are the time, to the millisecond.
  • The 13th is the version number, 7.
  • The next three count up, so IDs made in the same millisecond still sort in order.
  • Almost all of the rest is random.

Databases store version 7 keys more efficiently, because each new row lands at the end of the index instead of somewhere in the middle. Use version 4 when an ID must not reveal when it was made.

GUIDs, Braces, and Other Formats

A GUID is the same thing as a UUID. Microsoft tools usually write it in capitals and braces, like {3F2504E0-4F89-41D3-9A0C-0305E82C3301}: choose GUID, in braces and ABC under the format menu for that.

Every format holds the same 128 bits: the standard form with hyphens, no hyphens, a URN, or the raw bytes as Base64. For code and SQL, wrap each one in quotes with a comma. Make one or thousands at once, and download them as a text, CSV, or JSON file.

Check a UUID, below the generator, reads one back in any of these formats. It tells you the version and, for versions 7, 6, and 1, when it was made.

How Long Should an API Key Be?

Choose the strength, not the length. A key with 128 random bits can’t be guessed, and 256 bits is the usual choice for anything that signs or encrypts. How many characters each one takes:

StrengthHexBase64urlLetters and digits
128 bits322222
256 bits644343
512 bits1288686

Base64url is safe in web addresses, headers, and file names. Letters and digits only makes a random string you can select with a double click and paste anywhere. Hex uses only 0 to 9 and a to f; each pair of them is one byte.

A prefix such as sk_live_ tells people, and the secret scanners on code-hosting sites, what a key is for. It adds no strength, so it isn’t counted.

Secrets for JWT, WordPress, Django, and Laravel

JWT secret
HS256 needs at least 32 random bytes, HS384 48, and HS512 64. A short or guessable secret can be cracked offline from a single token.
WordPress
The eight lines of keys and salts for wp-config.php, made from the characters WordPress uses itself. Replace the old lines; everyone, you included, is signed out once you save.
Django
SECRET_KEY for settings.py: 50 characters from the same set Django’s own get_random_secret_key() uses.
Laravel
APP_KEY for .env: 32 random bytes in Base64 after base64:, the same as php artisan key:generate writes.
AES key
A raw 128-, 192-, or 256-bit key. Use a fresh random IV or nonce for every message too.

Turn on Config line to get the whole line, ready to paste. To read a token signed with your new secret, paste it into the JWT decoder.

Setting Up and Testing 2FA Codes (TOTP)

The 2FA tab is for setting up two-factor sign-in on your own app or website, or testing it. Never paste the 2FA secret of an account you use into any website, this one included: anyone who has it can make your codes.

It makes a new random secret and shows it the way authenticator apps expect: in Base32, as an otpauth:// link, and as a QR code that stays blurred until you press Show QR code, in case your screen is shared. Scan it with your app, and the page shows the same code your app does, with the previous and next ones and the seconds left.

Both sides work the code out from the secret and the current time, so nothing passes between them. That’s why a wrong clock is the usual reason codes don’t match. Type a code from your app into Check a code and the page says whether it’s valid now, was valid a moment ago, or is a minute out, which points to the clock.

  • Keep 6 digits, 30 seconds, and SHA-1 unless your app needs something else: many authenticator apps ignore other settings without saying so, and their codes then never match.
  • Testing your own server? Paste its secret, with or without spaces, or the whole otpauth:// link.
  • The secret isn’t saved or put in the page address. Leave the page and it’s gone, so this is no place to keep 2FA codes: that’s what an authenticator app is for.

Backup Codes, Coupon Codes, and Your Own Patterns

The Backup codes tab makes lists of random codes, every one different.

Backup
Ten recovery codes like k7qm-4xpa, for an app or site you build that offers backup codes with 2FA. Show each code to its owner once, and store them hashed, like passwords: a bcrypt hash works.
Coupons
A hundred codes like SALE-K7QM-4XPA, for a shop, an event, or a giveaway.
Custom
Your own pattern: X is a random letter or digit, # a digit, and anything else stays as you typed it. Put \ before an X or # to keep it as it is.

The characters menu picks letters and digits, digits only, or letters only, and leaves out look-alikes such as 0 and O, or 1, I, and L, so codes are easy to type from paper. Make a handful or tens of thousands, and download them as a text file or as a CSV that opens safely in a spreadsheet.

The line under the list says how many codes the pattern allows and the odds that one guess hits a real code. Those odds only protect you if the system that checks the codes also limits how many guesses each person gets.

Need backup codes for your own account? Get them from that account’s security settings: codes made here won’t work there.

Keeping Keys Safe

  • Copy a key when you make it. It isn’t saved anywhere, so it’s gone when you leave the page or make new ones.
  • Keep secrets in environment variables or your platform’s secret store, not in your code or a shared document.
  • Give each app, server, or person their own key, so you can cancel one without breaking the rest.
  • If a key ends up somewhere public, like a code repository or a chat, replace it at once. Deleting the message doesn’t take it back.
  • A UUID is an ID, not a password. IDs show up in web addresses and logs, so never use one to grant access. For a password a person types, use the password generator.

Frequently Asked Questions

What is a UUID?

A universally unique identifier: a 128-bit number, usually written as 32 hex characters in five groups, like 123e4567-e89b-42d3-a456-426614174000. Programs make them on their own, without asking a central list, and they still don’t clash. They are used as database keys, file names, and order or session IDs.

Is a GUID the same as a UUID?

Yes. GUID is Microsoft’s name for it, and the bits are the same. GUIDs are often written in capitals and braces. Some old Microsoft GUIDs use a different layout, which Check a UUID points out.

Can two UUIDs ever be the same?

In practice, no. A version 4 UUID has 122 random bits. You could make a billion every second for years before a repeat became even slightly likely.

Which UUID version is best for database keys?

Version 7, for most new projects: it sorts by time, so new rows go in quickly and the index stays compact. Choose version 4 when the creation time must stay private, for example in IDs that customers see.

Is it safe to make API keys in a browser?

Yes, when the page uses the browser’s secure random number generator and keeps the key on your device, as this one does. Some generator sites make keys on their server and send them to you, so a copy of your key has passed through someone else’s computer. Here, the key never leaves your device.

How many characters is a 256-bit key?

64 in hex, 43 in Base64url or in letters and digits, and 44 in standard Base64, which ends with an = for padding.

Can I use a UUID as an API key?

Better not. A version 4 UUID is hard to guess, but IDs end up in web addresses, logs, and screenshots, and a version 7 UUID shows when it was made. Use the API key tab for anything that grants access.

Why doesn’t the code from my authenticator app match?

Usually the clock: the code depends on the time, so a phone or server that’s a minute out makes different codes. Turn on automatic time in its settings. Otherwise, check that the app has the same secret and the same settings: the number of digits, how often the code changes, and the algorithm. Check a code on the 2FA tab tells you whether the clock is to blame.