Field Type Comparison
Compare Craft CMS field types to choose the right one for your content model.
| Field Type | Storage Format | Twig Syntax | GraphQL Type | Relational | Use Case |
|---|
Craft CMS Field Types — Complete Comparison Guide
Choosing the right field type is one of the most important decisions when designing a Craft CMS content model. Each field type stores data differently, exposes different Twig APIs, and may affect query performance depending on how it is used in templates. This comparison matrix covers all major native field types available in Craft CMS so you can make informed decisions before building your field layouts.
Plain Text and Number fields store values directly in the content database table alongside other element attributes. They are fast to query and straightforward to output in templates. Rich Text fields (powered by Redactor or CKEditor in Craft) also store in a text column but may contain HTML that should be output with the |raw filter or Craft's built-in handling.
Relational Field Types
Fields like Entries, Assets, Categories, Tags, and Users are relational — they store references to other elements in a separate relations table. These fields return element queries rather than raw values. In Twig, calling .all() fires a database query; to avoid N+1 query problems across entry loops, use the .with() eager-loading parameter on your parent query. For example: craft.entries().with(['heroImage', 'author']).all().
Matrix Fields in Craft 5
The Matrix field was significantly redesigned in Craft 5. Block types are now full nested entries with their own entry types, and the iteration variable changes from block (Craft 4) to entry (Craft 5). The inner field handles are now namespaced to their entry type. If you are upgrading from Craft 4, review your Matrix templates carefully — the switch from block.type.handle to entry.type.handle is a breaking change in all Matrix template loops.
GraphQL Considerations
When exposing content through Craft's built-in GraphQL API, field types map to specific GraphQL types. Scalar fields like Plain Text return String, Number returns Float or Int, and relational fields return typed interfaces like [EntryInterface] or [AssetInterface]. The Matrix field returns [EntryInterface] in Craft 5 since blocks are now entries. Always check the GraphQL schema explorer in the Craft control panel to confirm the exact type for your field configuration.