This paper describes an online handwritten Japanese character string recognition system based on conditional random fields, which integrates the information of character recognition, linguistic context and geometric context in a principled framework, and can effectively overcome the variable length of candidate segmentation. For geometric context, we employ both unary and binary feature functions, as well as the ones relevant and irrelevant to character classes. Experimental results show that the CRF based method outperforms the method with normalized path evaluation criterion, and the geometric context benefits the performance significantly.