Black codes were laws that limited the freedom of African Americans, its similar to slavery because it restricted the freedom of African Americans they were forced to sign labor contracts yearly and if they refused they were at risk of being arrested, fined, or forced into unpaid labor.