Skip to main content

SF-0079 · Concept · Easy

What is the maximum character limit of formula field?

✓ Verified by Vikas Singhal · Last reviewed 5/17/2026 · Updated for Spring '26

A formula field has three separate limits that interviewers tend to roll into one question. The headline answer is 3,900 characters of formula text, but you should know all three to avoid getting caught out on a follow-up.

The three limits

LimitValueWhat it measures
Formula text3,900 charactersThe raw expression you type into the formula editor
Compile size5,000 bytesThe compiled (post-substitution) size — cross-object refs and function expansions can blow this even when the text is short
Save result / output1,300 characters for Text return type (rendered output)What gets displayed on a page or row

Why the compile-size limit catches people

You can write a formula that’s only 1,200 characters but compiles to 6,000 bytes because of how Salesforce expands cross-object references and certain functions. When that happens you’ll see “Compiled formula is too big to execute” — a different error from “Formula is too long”.

Common culprits:

  • CASE() statements with many branches that reference the same long parent field path
  • Deeply nested IF() ladders
  • Repeated TEXT(picklist) calls

What to do when you hit either limit

See the dedicated follow-up What can we do if the requirement for formula field is very complex and it exceeds character limit? — short answer: split into multiple formulas, use helper formula fields, or move to a workflow/flow field update or Apex trigger.

What interviewers want to hear

  • The 3,900 character number, said confidently
  • That there’s a separate compile-size limit (5,000 bytes) that bites in real life
  • A practical workaround — chaining helper formula fields, or moving the heavy lifting to Apex

Verified against: Salesforce Help — Tips for Building Formulas. Last reviewed 2026-05-17 for Spring ‘26 release.