How can Cloudinary help me to avoid or detect duplicated uploads in my account?
Last updated: Oct-27-2026
Cloudinary provides several ways to prevent or identify duplicate images. The right approach depends on whether you want to:
Intentionally replace an existing asset when the same public ID is uploaded again
Prevent a repeated upload during the upload process
Identify identical files after they're uploaded
Identify visually similar images
Give identical files the same public ID
Review duplicates across your Media Library
Allow overwrite to intentionally replace an existing asset
If you want a repeated upload to update an existing asset rather than be skipped or create a duplicate, use the same public_id with overwrite: true.
Cloudinary then replaces the existing asset's file with the newly uploaded one, keeping the same public ID. Set invalidate: true as well so the updated asset is served from the CDN instead of a cached version of the original.
For details and examples, see Replacing existing assets.
Prevent repeated uploads during upload
To prevent an upload from replacing or creating another version of an existing asset, use a deterministic public_id with overwrite: false.
Cloudinary then checks whether an asset with that public ID already exists. If it does, Cloudinary skips the upload.
This prevents a public ID collision. It doesn't compare the contents of the files. For example, two different files can use the same public ID, and the same file can be uploaded with different public IDs.
For details and examples, see Avoiding duplicate uploads.
Detect identical images after upload
The Upload API includes an etag attribute in the upload response. This is an MD5 signature that you can use to recognize identical images. If the returned etag values match, the uploads are identical.
This comparison takes place after the upload completes. It can help you find and clean up duplicate files, but it doesn't prevent the upload.
Detect visually similar images
To compare images that may not be pixel-for-pixel identical, request a perceptual hash by setting phash to true during upload.
Cloudinary includes the pHash in the upload response. You can compare the values using your own similarity threshold to identify images that are visually similar. For example, the images may differ in compression, resolution, contrast, or brightness.
For more information, see How to automatically identify similar images using pHash and the pHash demo.
Give identical files the same public ID
You can configure Cloudinary to use an asset’s ETag value as its public ID.
Go to the Upload Defaults tab on the Upload page of your Console Settings. From the Public ID auto-generation mode dropdown, select ETag value of the asset.
This configuration applies to all new uploads after you enable it. It does not change the public IDs of existing assets.
Using the ETag (MD5 checksum) as the public ID gives identical files the same content-derived public ID. Configure the upload behavior appropriately if a repeated ETag should be skipped rather than replace the existing asset.
Review duplicates in the Media Library
The Cloudinary Duplicate Image Detection add-on (Beta) can identify duplicate or similar images in your Media Library. You can run it during upload or on images that are already stored in your product environment.
The add-on uses hashing algorithms to create fingerprints for selected images. A configurable threshold determines how close two fingerprints must be for the images to count as a match. The images therefore do not need to be identical; they may differ in compression, resolution, contrast, or brightness.
The add-on uses the moderation flow, so you can manually review and override decisions about an image. To enable it for your product environment, contact support.