Skip to content

In code

Generate a UUID in Ruby

SecureRandom.uuid ships with Ruby's standard library.

Ruby example

Ruby
require "securerandom"

id = SecureRandom.uuid

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.

4816b5a4-7777-4ca4-8487-515e0ba42068
curl https://getuuid.sh/api/uuid

Other languages

← Full API reference