[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) › idToUlid

```ts
function idToUlid(value: string & Brand<"Id">): string & Brand<"Ulid">;
```

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

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

The first 6 bytes of a ULID are its creation time in milliseconds. Ids
created by [createId](https://evolu.dev/docs/api-reference/common/Type/functions/createId) are random, so their ULIDs have a random time. Ids
created by [createIdAsUuidv7](https://evolu.dev/docs/api-reference/common/Type/functions/createIdAsUuidv7) store their creation time in the same
bytes, so their ULIDs keep it.

### Example

```ts
import {
  assertEqual,
  assertTrue,
  createIdFromString,
  idToUlid,
  Ulid,
  ulidToId,
} from "@evolu/common";

const id = createIdFromString("todo");
const ulid = idToUlid(id);

assertTrue(Ulid.is(ulid));
assertEqual(ulidToId(ulid), id);
```