Question: Can you make a DynamoDB table case-insensitive?

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Answer
No. DynamoDB has no collation or case-insensitivity setting. It compares strings by the bytes of their UTF-8 encoding, so key lookups, sort key conditions, begins_with, contains and filter expressions are all case-sensitive: Alice and alice are different partition key values.
The standard workaround is to store a normalized copy of the value and query the copy:
import { DynamoDBClient } from "@aws-sdk/client-dynamodb"; import { DynamoDBDocumentClient, GetCommand, PutCommand } from "@aws-sdk/lib-dynamodb"; const ddb = DynamoDBDocumentClient.from(new DynamoDBClient({})); const normalize = (email) => email.trim().toLowerCase(); // Write: key on the normalized value, keep the original for display const email = "Alice@Example.com"; await ddb.send( new PutCommand({ TableName: "Users", Item: { pk: `USER#${normalize(email)}`, email }, ConditionExpression: "attribute_not_exists(pk)", }) ); // Read: normalize the search term the same way const { Item } = await ddb.send( new GetCommand({ TableName: "Users", Key: { pk: `USER#${normalize("alice@example.COM")}` } }) );
If the value isn't part of the primary key, store the lowercased copy in its own attribute (for example emailLower), make it the key of a global secondary index and query the index. The condition in the example also makes the normalized value unique, so Alice@ and alice@ can't both register.
Tips:
- Normalize in one place and apply it to both writes and reads.
toLowerCase()is locale-independent; avoidtoLocaleLowerCase(), which changes letters such as the Turkish dotted i. - Filter expressions can't lowercase a value at query time, and a filter still reads every item it evaluates. See DynamoDB filter expressions.
- For search that ignores case and accents, or matches partial words, replicate the table to Amazon OpenSearch Service with the zero-ETL integration.
Source: AWS DynamoDB documentation.
Other Common DynamoDB FAQ (with Answers)
- Can DynamoDB trigger AWS Step Functions?
- Is DynamoDB serverless?
- Are DynamoDB table names unique?
- Is DynamoDB based on MongoDB?
- What does DynamoDB Query return?
- Can DynamoDB have null values?
- Is DynamoDB a wide-column store?
- How do you store location coordinates in DynamoDB?
- Does DynamoDB support Multi-AZ?
- Is DynamoDB OLTP or OLAP?
- How do you access DynamoDB from an Android app?
- Can Django use DynamoDB?
- How do you create an index in DynamoDB?
- How do you enable CloudTrail for DynamoDB?
- How do I create an ID in 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