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.
e184a1c3-5bcf-40e1-80db-cc7e84b0b4cd
curl https://getuuid.sh/api/uuid