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.

d5014054-bea2-4fdf-83bf-cb6faa2349cc
curl https://getuuid.sh/api/uuid

Other languages

← Full API reference