How do you calculate the endpoint of a titration?
Well, you need a balanced chemical equation for starters.
And given the balanced chemical equation, you need some means to signal the end point of a titration, when a stoichiometric equivalence of titrant has been added to the analyte.
For simple acid base titrations:
an acid base indicator, which has distinct colours in acidic/base is used to indicate the end of the reaction.