{
 "kind": "tool",
 "slug": "uuid",
 "path": "tools/uuid/",
 "name": "uuid",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Utilities",
   "tools/utilities/"
  ]
 ],
 "lead": "Unique IDs for records, files and links.",
 "chips": [
  {
   "label": "Utilities",
   "path": "tools/utilities/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install uuid"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/uuidjs/uuid"
  },
  {
   "label": "Website",
   "href": "https://github.com/uuidjs/uuid#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software",
   "note": "MIT allows use in paid and closed-source products.",
   "src": "https://github.com/uuidjs/uuid/blob/main/LICENSE.md"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 1, 2026",
   "note": "Latest GitHub release Oct 10, 2026. ",
   "src": "https://github.com/uuidjs/uuid"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "297 projects",
   "status": "info",
   "sub": "#4 of 408 in its category",
   "note": "Dependency in 297 public GitHub projects set up for AI coding agents that we scanned (4.7%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What uuid does",
   "parts": [
    {
     "t": "prose",
     "text": "uuid is a small free JavaScript package that makes UUIDs, long codes like 109156be-c4fb-41ea-b1b4-efe1671c5836. Your app can give every order, upload or message its own ID on the spot, without asking a database for the next number. It works in the browser and on a server, and it brings no other packages with it."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Random IDs for new orders",
       "text": "Each new order, upload or chat message gets an ID the moment it is made, even before it reaches your database.",
       "idea": false
      },
      {
       "title": "IDs that sort by creation time",
       "text": "Rows in a table or files in a folder line up in the order they were made when you sort them by ID.",
       "idea": false
      },
      {
       "title": "The same name always gets the same ID",
       "text": "Importing the same web page or product twice gives it the same ID, so you can spot the copy instead of storing it twice.",
       "idea": false
      },
      {
       "title": "Check IDs that arrive in links",
       "text": "Before you look up /orders/<id>, make sure the part after the slash really is an ID of the kind your app makes.",
       "idea": false
      },
      {
       "title": "IDs in a phone app",
       "text": "A React Native or Expo app makes IDs on the phone, offline, after one extra small package is loaded first.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "uuid popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "81",
       "of": "/ 100",
       "l": "Gid Score, #87 overall"
      },
      {
       "n": "402M",
       "l": "downloads a week, npm"
      },
      {
       "n": "15.3K",
       "l": "GitHub stars"
      },
      {
       "n": "297",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How uuid is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "uuid is a dependency in 297 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (6.1% of the 4,867 JavaScript/TypeScript ones), #4 of 408 in utilities.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 1,082; those are left out of every share on this page.",
      "The most used alternative in our scan is Nanoid (JavaScript) (104 projects).",
      "Projects that use it most often also use dotenv (48.1%), Zod (61.6%), TypeScript (86.2%).",
      "It is more common in projects set up for Roo Code (12.6%) than for OpenAI Codex (3.0%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "164 projects, 6.7%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "157 projects, 4.8%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "138 projects, 4.5%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "27 projects, 5.7%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "22 projects, 7.9%",
       "v": "Devin Desktop",
       "path": "agents/devin-desktop/"
      },
      {
       "l": "17 projects, 12.1%",
       "v": "Kiro",
       "path": "agents/kiro/"
      },
      {
       "l": "14 projects, 12.6%",
       "v": "Roo Code",
       "path": "agents/roo-code/"
      },
      {
       "l": "14 projects, 3.0%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 48.1% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 61.6% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 86.2% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 37.4% of its projects",
       "v": "date-fns",
       "path": "tools/date-fns/"
      },
      {
       "l": "In 65.7% of its projects",
       "v": "React",
       "path": "tools/react/"
      },
      {
       "l": "In 69.0% of its projects",
       "v": "ESLint",
       "path": "tools/eslint/"
      },
      {
       "l": "In 32.3% of its projects",
       "v": "Framer Motion",
       "path": "tools/framer-motion/"
      },
      {
       "l": "In 29.3% of its projects",
       "v": "Express",
       "path": "tools/express/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "uuid in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "No dependencies, and randomness comes from crypto",
       "v": "The README describes the package as zero-dependency and tree-shakable. It says random values come from the modern <code>crypto</code> API."
      },
      {
       "l": "v7 has a sequence counter you can set",
       "v": "<code>v7()</code> accepts an <code>options.seq</code> value. The README says you can provide it to help keep UUIDs unique when several are created in the same millisecond."
      },
      {
       "l": "Per-version validation",
       "v": "<code>validate()</code> returns true or false. <code>version()</code> returns the RFC version number. The README shows the two used together to accept only v4 UUIDs."
      },
      {
       "l": "Writes binary UUIDs into a buffer",
       "v": "The generators take an optional <code>buffer</code> and <code>offset</code>. If you pass a buffer, the function writes the binary UUID into it and returns the buffer instead of a string."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "ESM only from v12",
       "v": "Starting with <code>uuid@12</code>, CommonJS is not supported. The README links to notes on the implications and the reasons for the change."
      },
      {
       "l": "React Native needs a polyfill, imported first",
       "v": "The README says a \"getRandomValues() not supported\" error occurs in environments where the standard <code>crypto.getRandomValues()</code> API is not supported. For React Native / Expo, it says to install <code>react-native-get-random-values</code> and import it as the very first thing in your entry point."
      },
      {
       "l": "Passing options changes timestamp behavior",
       "v": "For <code>v1()</code>, <code>v6()</code> and <code>v7()</code>, the presence of an <code>options</code> argument is a flag. With <code>options</code>, the internal uniqueness state is not used and defaults are applied instead. This has been the behavior since <code>uuid@11</code>."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Accept only v4 UUIDs"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Javascript",
       "code": "import { version as uuidVersion } from 'uuid';\nimport { validate as uuidValidate } from 'uuid';\n\nfunction uuidValidateV4(uuid) {\n  return uuidValidate(uuid) && uuidVersion(uuid) === 4;\n}\n\nconst v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210';\nconst v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836';\n\nuuidValidateV4(v4Uuid); // ⇨ true\nuuidValidateV4(v1Uuid); // ⇨ false"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about uuid",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/broofa",
        "GitHub Sponsors: https://github.com/ctavan",
        "4 GitHub sponsors"
       ]
      },
      {
       "title": "Head to head",
       "items": [
        {
         "text": "uuid vs Nanoid (JavaScript)",
         "note": "used together in 21 projects",
         "path": "tools/compare/uuid-vs-nanoid/"
        }
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "zod: Schema validation",
        "typescript: Typed JavaScript",
        "dotenv: Env file loader",
        "date-fns: Date utilities",
        "eslint: JavaScript linter",
        "express: Node web framework"
       ]
      },
      {
       "title": "More in Utilities",
       "path": "tools/utilities/",
       "items": [
        {
         "text": "clsx",
         "path": "tools/clsx/"
        },
        {
         "text": "date-fns",
         "path": "tools/date-fns/"
        },
        {
         "text": "PyYAML",
         "path": "tools/pyyaml/"
        },
        {
         "text": "yaml",
         "path": "tools/yaml/"
        },
        {
         "text": "js-yaml",
         "path": "tools/js-yaml/"
        },
        {
         "text": "glob",
         "path": "tools/glob/"
        },
        {
         "text": "Lodash",
         "path": "tools/lodash/"
        },
        {
         "text": "tqdm",
         "path": "tools/tqdm/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "uuid",
       "me": true,
       "facts": [
        "MIT",
        "Gid 81",
        "402M/wk"
       ]
      },
      {
       "name": "Nanoid (JavaScript)",
       "why": "Pick Nano ID when you want short IDs for links and do not need the standard UUID format.",
       "path": "tools/nanoid-npm/",
       "facts": [
        "MIT",
        "Gid 81",
        "399M/wk"
       ]
      },
      {
       "name": "ULID",
       "why": "Pick ULID when you want IDs that sort by time and are shorter as text than a UUID.",
       "path": "tools/ulid/",
       "facts": []
      },
      {
       "name": "uuidv7",
       "why": "Pick uuidv7 when the only kind you need is the time-ordered version 7.",
       "path": "tools/uuidv7/",
       "facts": []
      }
     ],
     "more": "Compare uuid with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use the npm package uuid (pin uuid@14.0.3, ES module imports, Node 20 or newer) to give every new order a v7() ID, and check IDs that come in through links with validate() and version()."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add the package to your project.",
       "code": "npm install uuid",
       "src": "https://github.com/uuidjs/uuid/blob/main/README.md"
      },
      {
       "text": "Import the kind of ID you need by name and call it.",
       "code": "import { v4 as uuidv4 } from 'uuid';\n\nuuidv4(); // ⇨ 'b18794e8-5d0d-417c-b361-ba38e78411b4'\n",
       "src": "https://github.com/uuidjs/uuid/blob/main/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## uuid\n- Use ESM named imports such as `import { v4 as uuidv4 } from 'uuid'`. CommonJS is not supported from `uuid@12`.\n- In React Native / Expo, install `react-native-get-random-values` and put `import 'react-native-get-random-values'` as the very first import in the entry point.\n- For `v1()`, `v6()` and `v7()`, passing any `options` argument means the internal uniqueness state is not used. Calling them without `options` keeps that internal state in use.\n- For namespace UUIDs, the README quotes the RFC: if backward compatibility is not an issue, prefer `v5()` (SHA-1) over `v3()` (MD5). Use `v5.URL` or `v5.DNS` for the RFC namespaces.\n- `parse()` and `version()` throw `TypeError` if the string is not a valid UUID, and `stringify()` throws `TypeError` if a valid UUID string cannot be generated. `validate()` returns `true` or `false` instead.\n- Do not call `v8()`. The package does not offer it, though `validate()` and `version()` work with v8 UUIDs.\n"
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "const { v4 } = require('uuid') in a CommonJS project",
       "fix": "import { v4 as uuidv4 } from 'uuid' in an ES module project, or pin uuid@11 where only require() is possible",
       "why": "uuid 12 and later ship only ES modules."
      },
      {
       "dont": "import uuid from 'uuid'; uuid.v4()  or  require('uuid/v4')",
       "fix": "import { v4 as uuidv4 } from 'uuid'",
       "why": "The default export and the per-version deep imports were removed in uuid 8."
      },
      {
       "dont": "Running uuid 14 on Node.js 18",
       "fix": "Use Node.js 20 or newer, or pin uuid@13",
       "why": "uuid 14 dropped Node 18 and relies on the global crypto object."
      },
      {
       "dont": "Using v3() for new name-based IDs",
       "fix": "Use v5() with your own namespace UUID or v5.URL / v5.DNS",
       "why": "v3 uses MD5; the README quotes the standard that SHA-1 (version 5) is preferred."
      },
      {
       "dont": "Importing uuid first in a React Native app",
       "fix": "import 'react-native-get-random-values' as the very first line of the entry file, then uuid",
       "why": "Without it the app fails with \"getRandomValues() not supported\"."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Can I use it in a paid, closed-source app?",
       "a": "Yes. It is MIT-licensed; keep the license notice if you ship its files.",
       "evidence": {
        "url": "https://github.com/uuidjs/uuid/blob/main/LICENSE.md",
        "quote": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software."
       }
      },
      {
       "q": "Which kind of UUID should I use?",
       "a": "v4 for plain random IDs, v7 when IDs should sort by the time they were made, and v5 when the same name must always give the same ID.",
       "evidence": {
        "url": "https://github.com/uuidjs/uuid/blob/main/README.md",
        "quote": "Generate a version 7 (Unix Epoch time-based) UUID"
       }
      },
      {
       "q": "Why does require('uuid') or import uuid from 'uuid' not work?",
       "a": "Version 12 dropped CommonJS, and there has been no default export since version 8. Use named imports such as import { v4 as uuidv4 } from 'uuid'.",
       "evidence": {
        "url": "https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md",
        "quote": "For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export."
       }
      },
      {
       "q": "Can it make version 8 UUIDs?",
       "a": "No. The standard gives no recipe for them, so the package has no v8() function; validate() and version() still accept them.",
       "evidence": {
        "url": "https://github.com/uuidjs/uuid/blob/main/README.md",
        "quote": "The RFC does not define a creation algorithm for them, which is why this package does not offer a v8() method."
       }
      },
      {
       "q": "Can I make an ID in the terminal?",
       "a": "Yes, the package includes a small command; npx uuid prints a version 4 ID.",
       "evidence": {
        "url": "https://github.com/uuidjs/uuid/blob/main/README.md",
        "quote": "UUIDs can be generated from the command line using uuid."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm uuid"
  ],
  [
   "Category",
   "Utilities"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "v14.0.3, October 10, 2026"
  ],
  [
   "On GitHub since",
   "December 2010"
  ],
  [
   "Gid Score",
   "80.7"
  ],
  [
   "Rank in category",
   "#4 of 408"
  ],
  [
   "GitHub",
   "uuidjs/uuid"
  ],
  [
   "Last change",
   "Nov 1, 2026"
  ]
 ],
 "good": [
  "Since version 12 it works only with modern import lines; old projects that load packages with require() stay on version 11 or switch.",
  "Version 14 needs Node.js 20 or newer on a server, because it expects the built-in crypto object.",
  "Phone browsers are expected to work but are not tested; desktop Chrome, Safari, Firefox and Edge are."
 ],
 "checked_line": "Read by AgentGid from 4 official pages, card checked Nov 10, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/uuidjs.png"
}