toolqik

10 · Generators

API Secret Generator

Client ID and client secret pairs for OAuth apps and API integrations.

Runs in your browser
Secret strength
Encoding
Output
Credentials

  

About this tool

Many APIs authenticate machines with two values: a public client ID that identifies the app, and a private client secret that proves it. OAuth 2.0’s client-credentials flow, webhook partners, internal service accounts and payment integrations all use this pattern. This generator creates both, with a 256-bit secret by default, ready to paste into a .env file or a seed script.

Need a single bearer token instead? Use the API Key Generator.

How to use it

  1. Enter the app name; it becomes the variable names, such as PAYMENTS_CLIENT_ID.
  2. Set prefixes. A prefix like secret_ makes leaked secrets easy to recognise and lets secret scanners find them.
  3. Pick the strength and encoding, then copy the result or download it.

Handling client secrets safely

  • Show the secret once. Display it to the customer when it’s created, and never again.
  • Store only a hash of the secret on your server (SHA-256 is fine for long random secrets) and compare hashes in constant time.
  • The client ID isn’t secret. It can appear in logs and URLs; the secret must not.
  • Support rotation: allow two active secrets per client for a while, so integrations can switch without downtime.
  • Never put secrets in browser or mobile code, where anyone can read them. Those apps should use OAuth with PKCE instead.

FAQ

What is the difference between a client ID and a client secret?

The client ID publicly identifies the application; the client secret is a password that proves the request really comes from it. Only the secret must be kept private.

How long should a client secret be?

At least 128 bits of randomness; 256 bits (the default here) is the common choice.

What is the difference between an API key and an API secret?

An API key is usually a single token sent with each request. An API secret is paired with an ID and is often used to sign requests or obtain access tokens, so it is never sent alone.

Are these secrets generated securely?

Yes. They come from the browser’s cryptographically secure random number generator and are never sent anywhere.

esc
↑↓ navigate↵ open