If you have an active tuberculosis (TB) infection, isolating can help prevent the spread of bacteria to others. Isolation lasts at least 2 weeks. A doctor will let you know when to end your isolation.