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.
c58511fd-c3ff-47b5-b36c-c535c3652940
curl https://getuuid.sh/api/uuid