TAIPEI, July 18 (Reuters) - Taiwanese chipmaker TSMC posted a 36% rise in second-quarter net profit on Thursday that beat market expectations as it rides a surge in demand for semiconductors used in artificial intelligence applications.

Taiwan Semiconductor Manufacturing Co Ltd (TSMC), the world's largest contract chipmaker and a major Apple and Nvidia supplier, saw April-June net profit rise to T$247.8 billion from T$181.8 billion a year earlier.

The profit beat a T$238.8 billion LSEG SmartEstimate, which is weighted toward forecasts from analysts who are more consistently accurate. (Reporting by Yimou Lee and Faith Hung; Writing by Ben Blanchard; Editing by Muralikumar Anantharaman)