Simply back up each one you want to save using SQL Server Management Studio.
By default the tool plops the backups here:
C:\Program Files\Microsoft SQL Server\
<DB INSTANCE NAME>\MSSQL\Backup
C:\Program Files (x86)\Microsoft SQL Server\
<DB INSTANCE NAME>\MSSQL\Backup
(depends on if you installed 64-bit or 32-bit sql server)
Copy them out to someplace safe.
When you've reinstalled Windows and MSSQL Server, restore each database using SQL Server Management Studio. This part is niggly and unnecessarily tedious (thanks Microsoft).
But at the end of the day you will have your databases just as you left them before reformatting.