# What is Format-preserving encryption? Definition and meaning

An encryption mode whose output has the same length and character set as the input, such as a number that stays a number.

## Definition

**Format-preserving encryption**: An encryption mode whose output has the same length and character set as the input, such as a number that stays a number.

In short: Encryption that keeps the data's format.

## When it is used

Protecting fields in systems that cannot accept a different format.

## Learn more

The full guide to **[Format-preserving encryption](/tools/format-preserving-encryption)** explains how it works, when to use it and how it compares with the alternatives, with examples. The [glossary](/glossary) lists every term on the site from A to Z.

Previous term: [FlashAttention](/glossary/flashattention) · Next term: [FSDP](/glossary/fsdp)
