> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# When to Store Numbers as Text
- URL: https://nolongerset.com/storing-numbers-as-text/
- Published: 2021-11-26T03:25:34.000Z
- Updated: 2026-05-08T13:01:10.000Z
- Description: Introducing the "Numeroliteral Test," a one-question heuristic for deciding whether to store numeric data in a character-based field.
- Author: Mike Wolfe
- Tags: Database Design, #Import 2026-05-20 02:59

Not all number-based fields should be stored as numeric data types.

Any data that you can store in a numeric field can also be stored in a text field. So, how do you decide which one to choose? For example, how would you store the following?

- 5-digit US ZIP codes
- 9-digit (5 + 4) US ZIP codes
- Phone numbers
- International Standard Book Numbers (ISBN)
- Universal Product Codes (UPC)
- Stock Keeping Units (SKU)
- Check Numbers
- Bank Account Numbers
- Bank Routing Numbers
- Student Grades (0 - 100 scale)
- Student Grade Point Averages (0 - 4.0 scale)
- US Social Security Numbers

## The Numeroliteral Test

The word "numeroliteral" derives from the Latin *numerus* ("a number") and the Latin *litera* ("letter of the alphabet"). 

Yes, I made it up.

The **Numeroliteral Test** is a [heuristic](https://en.wikipedia.org/wiki/Heuristic%5F%28computer%5Fscience%29) for determining whether data should be stored in a numeric database type or a character-based database type. To apply the test, you need only answer one simple question:

1. **Does it make sense to add, subtract, multiply, or divide the contents of the field?**

If the answer is **Yes**, then store the data in a numeric field.

If the answer is **No**, then store the data in a character-based field.

---

### External references

[Heuristic (computer science) - Wikipedia![](https://en.wikipedia.org/static/apple-touch/wikipedia.png)Wikimedia Foundation, Inc.Contributors to Wikimedia projects![](https://wikimedia.org/api/rest_v1/media/math/render/svg/f1e239e8da24b16c820629d2fa16c7306574e6f9)](https://en.wikipedia.org/wiki/Heuristic%5F%28computer%5Fscience%29)

*Image by [Kamalakannan PM](https://pixabay.com/users/itkannan4u-151888/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=388996) from [Pixabay](https://pixabay.com/?utm%5Fsource=link-attribution&utm%5Fmedium=referral&utm%5Fcampaign=image&utm%5Fcontent=388996)*

***UPDATE*** *\[2021-11-26\]: Changed article title from "Storing Numbers as Text" to "When to Store Numbers as Text." URL slug stayed the same to avoid breaking links.*