If it is synced to iCloud, they will be synced across all devices if I'm not wrong. Erasing the computer (reinstalling the system) will simply erase the local bookmarks and access to your iCloud account, so all of your bookmarks will be there, unless you manually erase them all from your computer, which you shouldn't do in the first place.