# S3 bucket name checker

Free, in your browser · every current naming rule · works offline

## Check a bucket name

Checks the rules in your browser, offline too. It can’t tell whether another account already owns the name: only creating the bucket can.

Screenshot: S3 bucket audit: public, not blocked and unversioned buckets, with fixes

In the CloudConsole app

## Run this on your own account

Named the bucket? Then check how it’s set up. The app’s S3 bucket audit reads every bucket in your account: Block Public Access, whether its policy makes it public, versioning, default encryption, lifecycle rules and access logging.

[How the S3 bucket audit works →](https://cloudconsole.dev/app-tools/s3-bucket-security-audit)

[Download on the App Store](https://apps.apple.com/app/cloudconsole-for-aws/id6835419710) · [Get it on Google Play](https://play.google.com/store/apps/details?id=com.cloudconsole.app)

**Short answer**

An S3 general purpose bucket name must be 3–63 characters of lower-case letters, numbers, periods and hyphens, begin and end with a letter or number, have no two periods in a row, not look like an IP address, and avoid the reserved prefixes `xn--`, `sthree-` and `amzn-s3-demo-` and suffixes `-s3alias`, `--ol-s3`, `.mrap`, `--x-s3` and `--table-s3`. Avoid periods unless the bucket only hosts a static website.

## S3 bucket naming rules

Every new general purpose bucket, in every region, has to follow all of these:

1. Between 3 and 63 characters long.
2. Only lower-case letters, numbers, periods (`.`) and hyphens (`-`).
3. Begins and ends with a letter or number.
4. No two adjacent periods.
5. Not formatted as an IP address, such as `192.168.5.4`.
6. Doesn’t start with `xn--`, `sthree-` or `amzn-s3-demo-`.
7. Doesn’t end with `-s3alias` (reserved for access point aliases), `--ol-s3` (Object Lambda Access Point aliases), `.mrap` (Multi-Region Access Points), `--x-s3` (directory buckets) or `--table-s3` (S3 Tables buckets).
8. Ends with `-an` only when you create it in your account regional namespace (see below).

Valid: `amzn-s3-demo-bucket` appears in the AWS docs, but you can’t create it because of the reserved prefix; `app-assets-prod-2026` or `logs-a1b2c3d4` are fine. Not valid: `my_bucket` (underscore), `MyBucket` (capitals), `example..com` (adjacent periods), `my-bucket-` (ends with a hyphen).

Before 1 March 2018, buckets in US East (N. Virginia) could have names up to 255 characters with capitals and underscores. Some of those still exist, which is why you may see them in older accounts; you can’t create new ones.

## Periods in bucket names and HTTPS

Periods are valid but cause trouble. S3’s virtual-hosted-style URLs put the bucket name in the host name, `https://bucket-name.s3.region-code.amazonaws.com`, and the security certificates S3 uses for virtual hosting don’t work for bucket names with periods. So a request to `https://logs.example.com.s3.amazonaws.com` fails certificate validation unless you do your own certificate validation. Buckets with periods also can’t use Transfer Acceleration.

AWS recommends periods only for buckets used just for static website hosting, which is served over HTTP. If you want a custom domain over HTTPS, put CloudFront in front of the bucket; then the bucket name doesn’t have to match the domain at all.

## Global names and the account regional namespace

General purpose bucket names live in a namespace shared by every AWS account in a partition: `aws`, `aws-cn` (China), `aws-us-gov` (GovCloud US) and `aws-eusc` (European Sovereign Cloud). If anyone has the name, you can’t create it, and you get `BucketAlreadyExists`. When a bucket is deleted its name may become available again, but not necessarily straight away or at all, and another account could take it and receive requests meant for the old bucket. AWS’s advice is to empty a bucket you no longer need rather than delete it if that matters.

You can avoid clashes by creating the bucket in your **account regional namespace**, a reserved part of the global namespace where only your account can create buckets. These names follow a fixed pattern, your own prefix then your 12-digit account ID, the region and `-an`:

```
aws s3api create-bucket \
  --bucket amzn-s3-demo-bucket-111122223333-us-west-1-an \
  --bucket-namespace account-regional \
  --region us-west-1 \
  --create-bucket-configuration LocationConstraint=us-west-1
```

Replace the example prefix (it’s reserved) and use your own account ID and region. The checker above recognises names in this format and reminds you which account and region they belong to.

## Picking a good bucket name

- **Make it hard to guess.** If your code creates buckets, add a unique suffix, such as a GUID: `uuidgen | tr -d - | tr '[:upper:]' '[:lower:]'` gives 32 lower-case characters, and the code should cope with a name that is already taken.
- **Leave out secrets.** The name appears in URLs, DNS and logs. Don’t include customer names or anything sensitive.
- **Avoid “AWS” and “Amazon”.** AWS recommends choosing a name relevant to you and not associated with others.
- **Get it right first time.** You can’t rename a bucket or move it to another region. The only way is a new bucket and a copy, for example with `aws s3 sync s3://old-bucket s3://new-bucket`.

## Sources

- [Amazon S3 User Guide: General purpose bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html)
- [Amazon S3 User Guide: Virtual hosting of general purpose buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html)

## Questions

### What are the S3 bucket naming rules?

3 to 63 characters; only lower-case letters, numbers, periods and hyphens; begin and end with a letter or number; no two adjacent periods; not formatted like an IP address; not starting with xn--, sthree- or amzn-s3-demo-; and not ending with -s3alias, --ol-s3, .mrap, --x-s3 or --table-s3. Names ending in -an are only for buckets in your account regional namespace.

### Can S3 bucket names have uppercase letters or underscores?

Not any more. Before 1 March 2018 buckets in US East (N. Virginia) could have names up to 255 characters with capitals and underscores, and some of those still exist, but every new bucket in every region follows the current rules.

### Should I use periods (dots) in a bucket name?

Only for a bucket used just for static website hosting. With a period in the name, virtual-hosted-style HTTPS requests fail certificate validation unless you validate the certificate yourself, and the bucket can’t use Transfer Acceleration.

### Why is my bucket name already taken?

General purpose bucket names share one namespace across every AWS account in the partition, so someone else may own it. A deleted bucket’s name may not become available again straight away, or at all. Add something unique such as a random suffix, or create the bucket in your account regional namespace.

### Can I rename an S3 bucket?

No. A bucket’s name and region are fixed when you create it. Create a new bucket with the name you want, copy the objects across (for example with aws s3 sync), then delete the old bucket.

### Does this checker look up whether the name is free?

No. It checks the naming rules in your browser and sends nothing anywhere, so it can’t see other accounts’ buckets. Creating the bucket is the only reliable test of whether a name is available.

**Your buckets on your phone**

S3 has its own screen in CloudConsole: browse buckets and objects and preview files across your accounts and regions, on iPhone and Android, with your credentials kept on the phone.

[About the app →](https://cloudconsole.dev/aws-console-app)

## Related

- [BucketAlreadyExists: The requested bucket name is not available](https://cloudconsole.dev/errors/s3-bucketalreadyexists) – AWS error fix
- [aws s3 mb](https://cloudconsole.dev/cli/s3-mb) – AWS CLI
- [SSL validation failed for https://... certificate verify failed](https://cloudconsole.dev/errors/ssl-validation-failed) – AWS error fix
- [NoSuchBucket: The specified bucket does not exist](https://cloudconsole.dev/errors/s3-nosuchbucket) – AWS error fix
- [How to find public S3 buckets](https://cloudconsole.dev/how-to/find-public-s3-buckets) – How-to guide
- [AWS ARN parser](https://cloudconsole.dev/tools/arn-parser) – Free tool

---

Source: https://cloudconsole.dev/tools/s3-bucket-name-checker

CloudConsole is an independent iPhone and Android app for Amazon Web Services by Cloudconcur Ltd. It is not affiliated with Amazon Web Services.
