dynobase-icon
Dynobase

Error: dynamodb unable to parse base64 string

Rafal Wilinski

Answered by Rafal Wilinski

Last updated: October 23rd, 2026

Solution

“Unable to parse base64 string” means a value expected to represent binary data has an invalid encoding. Raw DynamoDB JSON represents Binary attributes as base64 strings. SDK APIs generally accept native bytes and perform the wire encoding for you.

import base64
import boto3

encoded = "aGVsbG8="
payload = base64.b64decode(encoded, validate=True)
db = boto3.client("dynamodb", region_name="us-east-1")
db.put_item(TableName="Files", Item={
    "id": {"S": "file-123"},
    "payload": {"B": payload},
})

Decode a data URL’s payload only after separating its prefix, and distinguish base64 from URL-safe base64. Reject malformed input instead of adding arbitrary padding. In JavaScript SDK v3, use a Buffer or Uint8Array for Binary. If the value is ordinary text, store it as a String attribute rather than marking it Binary.

Check whether an import tool expects DynamoDB JSON or plain application JSON. Encoding an already encoded string again produces the wrong stored bytes even if validation succeeds. IAM changes do not repair malformed base64.

See DynamoDB JSON conversion and AWS 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.