A factor analysis model represents linear relationships between latent variables and observed variables. Although this is widely used for analysis of psychological tests, nonlinear relationships often need to be analysed. Here, a nonlinear factor analysis model that uses spline transformation of latent variables is proposed. The conditional distribution of observed variables given by the latent variables is assumed to have means (or location parameters) that are expressed in nonlinear transformations of the latent variables. For binary valued observed variables, logits of the binomial mean parameters are expressed as piecewise polynomials of the latent variables. Linear factor analysis and two-parameter IRT (item response theory) models are special cases of this model. Discrete approximation of the latent variables enables easy adaptation for the missing values of a MAR (missing at random) condition. Properties of the model are examined by artificial data and test scores from other sources.