Skip to content

In code

Generate a UUID in Java

java.util.UUID is part of the JDK.

Java example

Java
import java.util.UUID;

String id = UUID.randomUUID().toString();

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.

e5ef1f68-c57d-4c29-8cae-0cdaa613c6df
curl https://getuuid.sh/api/uuid

Other languages

← Full API reference