CRF is the setting you use when you care how the video looks and are willing to accept whatever file size that produces. You give the encoder a quality target and it spends as many bits per scene as that target needs — lots on a fast pan, few on a static frame.
The scale runs roughly 18 to 32 in practice and it is inverted: lower CRF means higher quality and a larger file. CRF 18 is not "18% quality".
The usual advice is "use 23". Our measured sweep says that advice is incomplete, because the same CRF lands in completely different places depending on the footage. On 1080p clips encoded with libx264 at preset medium, CRF 23 scored:
| Footage | VMAF at CRF 23 | Bitrate |
|---|---|---|
| Screen recording | 95.5 | 1,244 kbps |
| Animation | 93.3 | 5,970 kbps |
| Camera | 92.5 | 5,705 kbps |
Push all three to CRF 32 and they separate much further: the screen recording still scores 89.9, while the camera footage collapses to 74.4. A single recommended number cannot serve both.
Worth knowing: CRF is the wrong tool when you have a hard ceiling to hit. It does not know what a megabyte is, so "CRF 23" and "under 20 MB" are unrelated requests, and hitting a cap by guessing at CRF values is a search. Use a target size for that, and CRF when size is negotiable.