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.
d3db5bf4-5314-4f3d-b0b5-9f7336e5897a
curl https://getuuid.sh/api/uuid