Most leases require you to tell your landlord if you want to sublet and give them time to consent to the sublease. If your lease includes this term then you do need to tell your landlord you want to sublet. If you don't then they could evict you for breach of your lease agreement.
The good news is that if your lease says nothing on the topic you don't have to tell them. This is true unless you live in Texas, Arkansas, Missouri, Alaska, Vermont, South Carolina, Oregon or Montana. In these states, lawmakers have gone to extra trouble to pass legislation that requires you to tell your landlord about a sublet and get their consent regardless of what's in your lease.
Have a specific question that's not answered in one of our Learn articles? Submit it here and we might be able to create a new article.