Sinh hàng trăm mã UUID v4 chuẩn RFC chỉ với 1 cú nhấp.
Công cụ này chạy hoàn toàn trên trình duyệt. Dữ liệu bạn nhập không rời khỏi thiết bị.
Advertisement
Công cụ này sinh hàng loạt mã UUID phiên bản 4 ngay trong trình duyệt, mỗi mã là một chuỗi 36 ký tự dạng 8-4-4-4-12. Bạn dùng khi cần khóa chính cho bảng dữ liệu, mã định danh cho tài liệu, hay ID tạm cho các bản ghi trước khi đẩy lên máy chủ.
UUID v4 chứa 122 bit ngẫu nhiên, và công cụ dùng nguồn ngẫu nhiên mật mã học của trình duyệt nên xác suất trùng gần như bằng không trong thực tế. Cần phân biệt với UUID v7 đang được dùng nhiều cho cơ sở dữ liệu: v7 sắp xếp theo thời gian nên ghi tuần tự tốt hơn, còn v4 hoàn toàn ngẫu nhiên và không cho biết thứ tự tạo.
Cách sử dụng
Nhập số lượng UUID cần tạo.
Chọn chữ hoa hay chữ thường và có giữ dấu gạch nối hay không.
Bấm tạo để sinh danh sách mã.
Sao chép toàn bộ hoặc tải về dạng file văn bản.
This generator produces UUID version 4 identifiers in bulk inside your browser, each a 36-character string shaped 8-4-4-4-12. Set how many you need, choose uppercase or lowercase, keep or drop the hyphens, and copy or download the whole list at once. It is useful for primary keys, document identifiers, or temporary IDs for records before they reach a server.
A v4 UUID carries 122 random bits, and this tool draws them from the browser's cryptographic random source, so a collision is effectively impossible in practice. Distinguish it from UUID v7, increasingly used for databases: v7 is time-ordered and writes more sequentially, whereas v4 is fully random and reveals nothing about creation order.
How to use
Enter how many UUIDs you need.
Choose uppercase or lowercase, and whether to keep the hyphens.
Generate the list.
Copy them all or download them as a text file.
Câu hỏi thường gặp
UUID v4 có thể bị trùng không?
Về lý thuyết là có, thực tế gần như không. Với 122 bit ngẫu nhiên, bạn phải tạo hàng tỷ mã mới có xác suất trùng đáng kể. Vì vậy hầu hết hệ thống dùng UUID làm khóa chính mà không cần kiểm tra trùng trước khi ghi.
UUID và số tự động tăng khác nhau thế nào?
Số tự tăng gọn, dễ đọc và sắp xếp tốt nhưng lộ số lượng bản ghi và khó gộp dữ liệu từ nhiều nguồn. UUID dài hơn nhưng sinh được ở nhiều nơi mà không cần hỏi máy chủ, nhờ vậy tránh xung đột khi gộp dữ liệu.
UUID v4 có chứa thông tin thời gian không?
Không. v4 hoàn toàn ngẫu nhiên, không mã hóa thời điểm tạo nên không thể sắp xếp theo thứ tự và không tiết lộ thông tin gì về bản ghi. Nếu cần sắp xếp theo thời gian, hãy dùng UUID v7 hoặc thêm cột thời gian tạo riêng.
Can a v4 UUID collide?
In theory yes, in practice effectively no. With 122 random bits you would need to generate billions of identifiers before a collision becomes plausible, which is why most systems use UUIDs as primary keys without checking for duplicates first.
How does UUID differ from an auto-increment ID?
Auto-increment integers are compact, readable, and sort well, but they leak record counts and complicate merging data from multiple sources. UUIDs are longer yet can be generated anywhere without asking a server, avoiding conflicts when data is merged.
Does a v4 UUID contain a timestamp?
No. v4 is entirely random with no encoded creation time, so it cannot be sorted chronologically and reveals nothing about the record. If ordering by time matters, use UUID v7 or add a separate created-at column.