The effect of interstitial and substitutional impurities on grain boundary (GB) cohesion in the series of B2-TiMe alloys is studied from first principles using pseudopotential approach. It is shown that the TiMe Σ5(310) symmetrical tilt GB cohesion is reduced by the segregation of hydrogen while it is increased due to boron or carbon segregation. We analyze also the combined and accumulation effect of interstitial B (C) and H impurities on the change of the Griffith work.