Question: How do you handle empty strings in DynamoDB?

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Answer
Store an empty string directly in a non-key DynamoDB attribute; no service setting is required. Empty String and Binary values are allowed outside key attributes, including inside maps and lists.
A JavaScript v3 document-client item can contain nickname: "". By default, that value remains a String. Setting marshallOptions.convertEmptyValues: true converts supported empty values to NULL instead, so use that option only if null is the representation your application intends.
These cases are different:
""is a present String with zero length.nullis a present NULL attribute.- An omitted attribute is absent.
- An empty set is invalid, while an empty list or map is valid.
Table and index key values cannot be empty strings or empty binary values. For a sparse GSI, omit an index-key attribute when the item should not be indexed; do not write an empty string as a substitute.
Check the stored type when migrating old code that used automatic empty-value conversion. Changing the client configuration can change filters and conditions even if the application still displays the field as blank. See data types and NULL behavior.
Source: AWS empty-value support.
Other Common DynamoDB FAQ (with Answers)
- How do you dump multiple DynamoDB tables?
- Can DynamoDB have duplicates?
- How do you parallelize requests in DynamoDB?
- How is data stored in DynamoDB?
- Is DynamoDB ACID compliant?
- Can a DynamoDB range key be a GSI key?
- Is DynamoDB HIPAA compliant?
- Can you store lists in DynamoDB?
- Can DynamoDB have nested objects?
- Can you make a DynamoDB table case-insensitive?
- Can Amazon Data Firehose write to DynamoDB?
- How do you store a graph in DynamoDB?
- Can colons and special characters be used in DynamoDB attributes?
- Is DynamoDB a memory store?
- Can Tableau connect to DynamoDB?
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today
Product Features
DynamoDB Tools
- SSH GUI Client
- Chat With Cloud
- MongoDB GUI Client
- AWS Cost Monitoring
- DynamoDB Query Builder
- DynamoDB Code Examples
- DynamoDB Node.js Queries
- DynamoDB JSON Converter
- DynamoDB UUID Generator
- DynamoDB Local Admin GUI
- DynamoDB Pricing Calculator
- DynamoDB Single-Table Design
- Best DynamoDB GUI Clients
- Dynobase vs DynoTable