Skip to content

In code

Generate a UUID in JavaScript

crypto.randomUUID() is built in to every modern browser and Node 19+.

JavaScript example

JavaScript
// Browsers + Node 19+
const id = crypto.randomUUID();

No install? Use the tool or API

Here's a fresh version 4 UUID generated right now — copy it, or call the API from any language.

307a8f11-9e86-4d26-914c-c3f3ae2f631f
curl https://getuuid.sh/api/uuid

Other languages

← Full API reference