Rails secret_key_base Generator

128 hex characters from 64 random bytes, in exactly the format Rails expects.

Very strong0 bitsGenerated in your browser

Local alternative

rails secret

Prefer generating secrets on the machine that uses them? This command produces an equivalent value.

Official documentation

Rails derives every other key from secret_key_base, including those for signed cookies and Active Record Encryption. In development the value lives in credentials, in production usually in an environment variable. Rotating it invalidates existing signed cookies and signs every user out.

Frequently asked questions