Difference between は and が

DenotesTopic (and subject)Subjectが denotes a subject 主語 but not topic 主題
は denotes topic 主題 which can also be the subject 主語
ImportanceSentence after はSentence before がSentence that comes before が is more important than sentence after it
Sentence that comes after は is more important than sentence before it
InformationOldNewが is like ‘a’ and は is like ‘the’ in English
When something is unknown to listener (or speaker), が is used
When something is known to both speaker and listener, は can be used
Example: 昔、おじいさんがいました。おじさんは優しいです。
Applies toFull clauseSub clauseが is valid for the immediate sentence that follows
は is valid for the entire sentences that follows
FunctionExplanationDescriptionが describes a phenomenon or situation
は explains about the topic
ScopeNo limitLimitedが has the inherent meaning of excluding what is not denoted by が
は does not but is used in comparison