Saving voxel terrain

So I have made voxel based game. My problem is that how I can save the terrain? And the terrain is infinity and always random (like Minecraft). So how I can save and load terrains with C#?

Thanks in advance!

You wouldn’t save the terrain but the voxel data itself. How you save it and how you manage it is up to you.

The Minecraft wiki has some useful links on that topic: