[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Type](https://evolu.dev/docs/api-reference/common/Type) › uuidToId

```ts
function uuidToId<B extends string = never>(
  value: string & Brand<"Uuid">,
  ..._validation: IdBrandValidation<B>
): CreatedId<B>;
```

Defined in: [packages/common/src/Type.ts:10565](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/common/src/Type.ts#L10565)

Converts a [Uuid](https://evolu.dev/docs/api-reference/common/Type/variables/Uuid) to the [Id](https://evolu.dev/docs/api-reference/common/Type/variables/Id) with the same 16 bytes.

Use this to store records whose external keys are UUIDs. Unlike
[createIdFromString](https://evolu.dev/docs/api-reference/common/Type/functions/createIdFromString), the mapping is reversible with [idToUuid](https://evolu.dev/docs/api-reference/common/Type/functions/idToUuid), so
the original UUID does not need its own column. A time-based UUID, such as
version 1, 6, or 7, keeps its creation time in the Id.

### Example

```ts
import {
  assertEqual,
  assertType,
  idToUuid,
  Uuid,
  uuidToId,
  type Brand,
  type Id,
} from "@evolu/common";

const uuid = Uuid.orThrow("0190a6f4-8c3e-7b2a-9d41-5e6f7a8b9c0d");
const todoId = uuidToId<"Todo">(uuid);

assertEqual(todoId, "AZCm9Iw-eyqdQV5veoucDQ");
assertType<typeof todoId, Id & Brand<"Todo">>();
assertEqual(idToUuid(todoId), uuid);
```