# getSizeFromPieceCID

> **getSizeFromPieceCID**(`pieceCidInput`): `number`

Defined in: [packages/synapse-core/src/piece.ts:133](https://github.com/FilOzone/synapse-sdk/blob/2c515fb6328c4f7a68ed82653d96ab11299e177d/packages/synapse-core/src/piece.ts#L133)

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