dynobase-icon
Dynobase

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

Rafal Wilinski

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; avoid toLocaleLowerCase(), 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.

Dynobase is a Professional GUI Client for DynamoDB

Start your 7-day free trial today

Product Features

Download
/
Changelog
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
© 2026 Dynobase
+
Still using AWS DynamoDB Console?
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.