# getSizeFromPieceCID

```ts
function getSizeFromPieceCID(pieceCidInput): number;
```

Defined in: [packages/synapse-core/src/piece.ts:228](https://github.com/FilOzone/synapse-sdk/blob/1d6c4b9fe34534bf1087dfe41491b72be0b46858/packages/synapse-core/src/piece.ts#L228)

Extract the raw (unpadded) size from a PieceCIDv2

Accepts PieceCID as string, CID object, or PieceCID type

## Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `pieceCidInput` | `string` \| `PieceLink` \| `CID`\<`unknown`, `number`, `number`, `Version`\> | PieceCID as either a CID object or string |

## Returns

`number`

The raw size in bytes

## Throws

If the input is not a valid PieceCIDv2